View Full Version : Errors in Explorer results
Willij
7th September 2004, 06:34 PM
Using Explorer under the Results tab, after setting up code to produce "trades for TradeSim", some of the securities give a result of "N/A" and others give the number of trades e.g "2.0000". I have checked the error log for a sample of the "N/A" results and the following error is shown in the error log "Error Detected in [CCE] caused by Invalid array index."
By the way, when the results of the exploration are processed through TradeSim, the securities that give the sensible "x.0000", when checked manually do Enter and Exit at the defined date and price.
Any help with this would be appreciated.
Thanks
Jeff
David Samborsky
8th September 2004, 12:58 PM
Have you specified enough data to process in the data loading options ?
Willij
9th September 2004, 09:37 AM
Hello David,
I am testing from 1999 to 2004 and have set to load 2000 records. I am assuming 250 trading days per year, so I should only need 1250 to cover the time so I have added a few more.
Thanks
Jeff
David Samborsky
9th September 2004, 11:44 AM
Could you either post or send me your trade database exploration.
Willij
17th September 2004, 08:36 PM
Hello David,
I emailed you directly the exploration about a week ago, but I must have made an error somewhere, so here is the part of the exploration I believe is giving me the problem. If I replace the AdvStop with the standard ATR trailing Stop, the exploration returns the proper result ie without the N/A result.
LongEntryPrice:=Ref(C+.5*ATR(30),-1);
LongEntryPrice2:=If(LongEntryPrice>O,O,LongEntryPrice);
LongInitialStop:=LongEntryPrice2-2.5*ATR(30);
AdvStop:=ExtFml("AdvancedStop.StopLong",longentrytrigger,LongInitialStop,0,H-3.5*ATR(30),C+4*ATR(30),H-3.0*ATR(30),C+6*ATR(30),H-2.5*ATR(30));
LongExitTrigger:=C<=AdvStop;
LongExitPrice:=OPEN;
ExtFml( "TradeSim.Initialize");
ExtFml("TradeSim.GetSymbolLength")<=3;
ExtFml("TradeSim.EnableProtectiveStop",1);
ExtFml("TradeSim.SetStartRecordDate",13,8,1999); ExtFml("TradeSim.SetStopRecordDate",13,8,2004); ExtFml( "TradeSim.EnableDelayOfEntryByOneBar")
;
ExtFml( "TradeSim.EnableDelayOfAllExitsByOneBar"); ExtFml("TradeSim.RecordTrades","MySystem3 ATR TS", Long, LongEntryTrigger, longEntryPrice2, LongInitialStop,LongExitTrigger, longExitPrice, START);
Jose
17th September 2004, 10:51 PM
The problem here is most likely your AdvancedStop trailing stop.
There is no way to verify this without your LongEntryTrigger code, but it's likely that the trailing stop may need more periods than your loaded 2000 for it to kick in, thus the N/A null bars.
Plot the AdvancedStop trailing stop as an indicator on the N/A charts to find out if this is so.
jose '-)
Willij
20th September 2004, 08:12 PM
Hello Jose,
My trigger code is
LongEntryTrigger:=C>Ref(HHV(H,20),-1) AND
C>0.5 AND
ATR(30)/C>=0.01 AND
Mov(C,21,S)*Mov(V,21,S)>300000 AND
Mov(C,200,S)>Ref(Mov(C,200,S),-50)+5*ATR(200);
Thanks
Jeff
Jose
21st September 2004, 02:31 AM
Jeff, your first entry signal from your trigger code takes a while to kick-in, and will not give any signals at all on stocks below 50c.
Since your AdvancedStop trailing stop will not begin to plot until it receives the first signal from your trigger code, it will not plot at all on any charts without any trigger signals, thus the N/A results in your TradeSim exploration.
Plot your AdvancedStop trailing stop as an indicator on the N/A charts to verify this.
jose '-)
Willij
21st September 2004, 09:37 AM
Jose,
Thanks, I'll try that and let you know.
Cheers
Jeff
Willij
23rd September 2004, 03:22 AM
Hello Jose,
I confirmed that the trailing stop did not plot on the N/A results. Could you please advise if the stocks that give a proper result eg x.xxxx in MetaStock and consequently run in TradeSim give an indication of the performance of the system ie is it a legitimate back test for that system.
Many thanks
Jeff
Jose
23rd September 2004, 06:56 AM
Jeff, it should be fine.
Stocks that don't trigger any signals, may as well not exist as far as your system is concerned - there is no difference.
jose '-)
Willij
24th September 2004, 01:51 AM
Jose
Thanks for your help with my questions.
Cheers
Jeff
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.