GAP different values EA and Indicator (Half Trend)
Forums › ProRealTime English forum › ProOrder support › GAP different values EA and Indicator (Half Trend)
- This topic has 13 replies, 3 voices, and was last updated 7 years ago by
Nicolas.
-
-
10/11/2017 at 11:30 AM #49023
Hi everyone,
I’m using the Halftrend Triple I founded here on PRC.
I noticed that when I copy the code in a EA, there are some differencies between the value of the halftrend with identical parameters .
Sometimes they are the same, sometimes not.
Do you have any explanation on it ?
Thanks !
HalfTend123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960amplitude2 = 60lowpricei1 = Lowest[Amplitude1](low)highpricei1 = Highest[Amplitude1](high)lowma1 = average[Amplitude1](low)highma1 = average[Amplitude1](high)if barindex>Amplitude1 thenif(nexttrend1=1) thenmaxlowprice1=Max(lowpricei1,maxlowprice1)if(highma1<maxlowprice1 and Close<Low[1]) thentrend1=1.0nexttrend1=0minhighprice1=highpricei1endifendifif(nexttrend1=0) thenminhighprice1=Min(highpricei1,minhighprice1)if(lowma1>minhighprice1 and Close>High[1]) thentrend1=0.0nexttrend1=1maxlowprice1=lowpricei1endifendifif(trend1=0.0) thenif(trend1[1]<>0.0) thenup1=down1[1]elseup1=Max(maxlowprice1,up1[1])endifdown1=0.0elseif(trend1[1]<>1.0) thendown1=up1[1]elsedown1=Min(minhighprice1,down1[1])endifup1=0.0endifendifif up1>0 thenhalftrend1 = up1color1 = 1elsehalftrend1 = down1color1 = -1endif10/11/2017 at 12:07 PM #4902810/11/2017 at 12:57 PM #4903110/12/2017 at 11:26 AM #49111Hello Nicolas,
here is the code, I use it on dax M15, I noticed a difference between Halftrend 10 on EA and Indicator, on october 9th 2017 at 6am for example (halftrend10 graph by EA = 12976,9 ; halftrend10 on indicator= 12 975,1)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163Amplitude1 = 10Amplitude2 = 60N=3//////////////////////////////////////////HL #1lowpricei1 = Lowest[Amplitude1](low)highpricei1 = Highest[Amplitude1](high)lowma1 = average[Amplitude1](low)highma1 = average[Amplitude1](high)if barindex>Amplitude1 thenif(nexttrend1=1) thenmaxlowprice1=Max(lowpricei1,maxlowprice1)if(highma1<maxlowprice1 and Close<Low[1]) thentrend1=1.0nexttrend1=0minhighprice1=highpricei1endifendifif(nexttrend1=0) thenminhighprice1=Min(highpricei1,minhighprice1)if(lowma1>minhighprice1 and Close>High[1]) thentrend1=0.0nexttrend1=1maxlowprice1=lowpricei1endifendifif(trend1=0.0) thenif(trend1[1]<>0.0) thenup1=down1[1]elseup1=Max(maxlowprice1,up1[1])endifdown1=0.0elseif(trend1[1]<>1.0) thendown1=up1[1]elsedown1=Min(minhighprice1,down1[1])endifup1=0.0endifendifif up1>0 thenhalftrend1 = up1color1 = 1elsehalftrend1 = down1color1 = -1endif/////////////////////////////////////////////////////// -- HL #2lowpricei2 = Lowest[Amplitude2](low)highpricei2 = Highest[Amplitude2](high)lowma2 = average[Amplitude2](low)highma2= average[Amplitude2](high)if barindex>Amplitude2 thenif(nexttrend2=1) thenmaxlowprice2=Max(lowpricei2,maxlowprice2)if(highma2<maxlowprice2 and Close<Low[1]) thentrend2=1.0nexttrend2=0minhighprice2=highpricei2endifendifif(nexttrend2=0) thenminhighprice2=Min(highpricei2,minhighprice2)if(lowma2>minhighprice2 and Close>High[1]) thentrend2=0.0nexttrend2=1maxlowprice2=lowpricei2endifendifif(trend2=0.0) thenif(trend2[1]<>0.0) thenup2=down2[1]elseup2=Max(maxlowprice2,up2[1])endifdown2=0.0elseif(trend2[1]<>1.0) thendown2=up2[1]elsedown2=Min(minhighprice2,down2[1])endifup2=0.0endifendifif up2>0 thenhalftrend2 = up2color2 = 1elsehalftrend2 = down2color2 = -1endif//////////////////////////////////////////////////////////////////////// CONDITIONS ENTREE LONG /////////////////////////////////////////////////////////////////////////////IF (up2 > 0 and down1[1] > 0 and up1 > 0) OR(up1 > 0 and down2[1] >0 and up2 > 0) thenBuy N contract at marketSet stop ploss 50ENDIFIF color1 thenENDIFIF color2 thenENDIF//////////////////////////////////////////////////////////////////////// CONDITIONS SORTIE LONG /////////////////////////////////////////////////////////////////////////////IF longonmarket theniF halftrend1[1] > halftrend1 thenSell at marketENDIFENDIFGRAPH HAlftrend1GRAPH HAlftrend210/12/2017 at 12:33 PM #4912310/12/2017 at 12:37 PM #49125Did you try on M15, GER30, 9 October 2017 at 6:00 am ? these are not exactly the same for me.
95% of the time these are the same, but the 5% where these differs make difference between arrow (entry) in my Indicator and real entry in proOrder.
10/12/2017 at 12:43 PM #49131Maybe you have the optional setting of not using weekend data? And any monday morning data based on calculations from friday’s data in the indicator, might differ from the backtest on PRT server using weekend data (even if you chose not to on your pc)? Had a similar thing long ago and that’s when Nicolas told me about this weekend data option not affecting backtest run on PRT servers but only indicators on PC…
10/12/2017 at 12:54 PM #49132Thank’s Noobywan. Actually I thought about this possibility, and I remember I tried with and without weekend datas but I didn’t change. the value are identical (unless for the date I’m a comparing).
Whatever I’m pretty sure that value overnight and weekend are commited to these differencies in value..
10/12/2017 at 2:52 PM #4914110/12/2017 at 2:58 PM #4914410/12/2017 at 3:36 PM #4915110/16/2017 at 9:07 AM #49494Bonjour Nicolas, oui je suis chez IG, mais j’effectue ces backtest sur PRT CFD.
Je pense que le problème est résolu, c’était bien l’histoire de données du week-end qu’il fallait activer, j’avais du me planter en essayant des réglages..
Une fois les données activée pour le weekend je n’ai plus de Gap entre le vendredi soir et le lundi matin, j’ai maintenant une bougie. Dans le Backtest elle devait bien être prise en compte, mais pas dans l’indicateur qui considérait un gap.
Merci pour votre aide !
10/16/2017 at 9:13 AM #4949810/16/2017 at 10:06 AM #49514 -
AuthorPosts
Find exclusive trading pro-tools on