How about inputting a custom spread when backtesting? Expand / Collapse
Author
Message
Posted 3/17/2010 12:06:35 PM


Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 3/17/2010 12:04:46 PM
Posts: 23, Visits: 22
Is there any way to input a custom spread instead of the default one before launching the strategy in the Tester?
Post #1211
Posted 3/29/2010 1:00:04 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2/7/2012 10:15:57 AM
Posts: 445, Visits: 818
Seems to me that, outside of running in tick mode, the Tester more or less guesses where to buy or sell. The reasons they made it do this is that in Live trading, no trades are executed exactly at the requested instant except by accident, and because they can't make it work realistically any other way.

While I don't know how the Tester is programmed, if you wanted it to open a position precisely at the close of a period, the Tester will act like it waited a few seconds, and not open the position exactly at the close price. It might even open the position at the high or low of the new period, depending on which one came first after the close of the period. There almost isn't any other way for the programmers to do this outside of running a Tick mode History along with the regular History you are using. Running in Tick mode can bog your computer down unless you are running with, say, something like 12 megabytes of ram memory or more. Also, the Tick mode numbers downloaded from your broker might be a tremendously large file if you are, say, running in Day mode and testing 100 days. You can program a Tick History right along with your regular History in a Strategy to make things as accurate as they can get in the Tester.

Here is the basic answer to your question. To make the Tester work with custom spreads, or without spreads, or to make it trade exactly at the close of a period, you need to write some of the math programming yourself, and the results need to output to the log. That is, your answers will need to be in the Log tab and not the regular Statistics tab. You might have to actually program the indicators you use rather than relying on the pre-programmed ones that ActForex has built into ActTrader.

For example, you might literally need to use a
FOR loop to add together the
History.Last(i).Close numbers over a certain
Period so that you can divide the
sum of the History.Last(i).Close numbers by the Period to get the
Simple Moving Average (SMA) for the Period.

Or if you want the Exponential Moving Average, you might have to use the formula
EMA = (2/(Periods+1)*(History.Last(1).Close-PreviousEMA))+PreviousEMA;
and then do something with the EMA.

If (EMA > SMA)
and (PreviousEMA < PreviousSMA) then
begin // (beginning a Buy)
MyOpenPos = History.Last(1).Close+MySpread;
end;

Then you need to add scripting for the Limit and Stop to happen, or if you want to close on a reversal, and then you need to log it all.

log('My results: ' +FloatToStr(MyResults)); // And add the date and time and anything else, of course.

My personal results in an Excel spreadsheet are not accurate as far as Live trading, either. But they are more accurate in some ways than the Tester. And I can adjust the settings far easier. The problem with Excel is that it is hard to program a Macro to run the numbers like ActTrader, into a graph that is being built as the numbers are being run.

I use Excel to verify ahead of time whether or not a particular Strategy that I want to build in ActTrader will likely work. If the results in Excel don't look good, I usually won't build it in ActTrader.

When using periods of 1-Hour or longer, Excel results are more accurate than the Tester. This is because Excel does it exact, and while Live trading still doesn't do it exact, the difference between exact and Live, percentage-wise, are usually smaller with regard to Stops, Limits and the distance that the price moves between periods. This means that you have a better chance of profiting with whatever Limit and Stop you are using.




Edited: 3/29/2010 1:11:04 PM by black
Post #1266
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin

All times are GMT -5:00, Time now is 11:50am


© 2009 Actforex.com Terms of Use