Confirmation of Trend using Neural Networks (by kind permission of Leo)
Forums › ProRealTime English forum › ProOrder support › Confirmation of Trend using Neural Networks (by kind permission of Leo)
- This topic has 37 replies, 8 voices, and was last updated 6 years ago by GraHal.
Tagged: data mining, machine learning, neural network
-
-
08/28/2018 at 7:03 AM #79212
this would be nice for the dax. Because of the Margin. It´s the half of Dow. Anyone tried?
08/28/2018 at 8:57 AM #79220Mmm thought it was a bit too good to be true! Just a bit though! 🙂
I have done a pessimistic calculation / check of results and £300 – £400 of profit is due to the spike we have had to endure at 21:15 on the Dow for the last 5 nights or so.
4 trades have been affected at 21:15, 1 lost around 350 due to the spike and 3 gained 200 due to the spike!
The 4 spiked tradess may have gone on to be gainers anyway if the spike hadn’t triggered the SL and TP. I guess I could work this out, but the coffee hasn’t worked through yet! 🙂
Results are still good though as v1.0 is currently trading at a genuine around £600 profit over 6 days (950 – 350 due to IG spikes! ).
I will put a time filter on the strategy when I get chance.
08/29/2018 at 11:44 AM #79288Vonasi proposed so here it is … SPTRD on 1 Min TF 100k bars, spread = 4
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556DEFPARAM CUMULATEORDERS = False//Variables:candlesback=5ProfitRiskRatio=2spread=1.5myATR=average[20](range)+std[20](range)ExtraStopLoss=MyATR//ExtraStopLoss=3*spread*pipsize//for long tradesclassifierlong=0FOR scanL=1 to candlesback DOIF classifierlong[scanL]=1 thenBREAKENDIFLongTradeLength=ProfitRiskRatio*(close[scanL]-(low[scanL]-ExtraStopLoss[scanL]))IF close[scanL]+LongTradeLength < high-spread*pipsize thenIF lowest[scanL+1](low) > low[scanL]-ExtraStopLoss[scanL]+spread*pipsize thenclassifierlong=1//candleentrylong=barindex-scanLBREAKENDIFENDIFNEXTIF classifierlong=1 and Close > Average[120](close)then//DRAWSEGMENT(candleentrylong,close[barindex-candleentrylong],barindex,close[barindex-candleentrylong]+LongTradeLength) COLOURED(0,150,0)//DRAWELLIPSE(candleentrylong-1,low[barindex-candleentrylong]-ExtraStopLoss,barindex+1,high+ExtraStopLoss) COLOURED(0,150,0)Buy 2 Contract at MarketENDIF//for short tradesclassifiershort=0FOR scanS=1 to candlesback DOIF classifiershort[scanS]=1 thenBREAKENDIFShortTradeLength=ProfitRiskRatio*((high[scanS]-close[scanS])+ExtraStopLoss[scanS])IF close[scanS]-ShortTradeLength > low+spread*pipsize thenIF highest[scanS+1](high) < high[scanS]+ExtraStopLoss[scanS]-spread*pipsize thenclassifiershort=1//candleentryshort=barindex-scanSBREAKENDIFENDIFNEXTIF classifiershort=1 and Close < Average[120](close) then//DRAWSEGMENT(candleentryshort,close[barindex-candleentryshort],barindex,close[barindex-candleentryshort]-ShortTradeLength) COLOURED(150,0,0)//DRAWELLIPSE(candleentryshort-1,high[barindex-candleentryshort]+ExtraStopLoss,barindex+1,low-ExtraStopLoss) COLOURED(150,0,0)SellShort 2 Contract at MarketENDIFSET TARGET PROFIT 70SET STOP PLOSS 3508/29/2018 at 8:09 PM #79311Vonasi proposed so here it is … SPTRD on 1 Min TF 100k bars, spread = 4
Why 4 pips? The SP500 spread is never that big.
08/29/2018 at 8:18 PM #79312Hey Everyone!!
Such a nice work!! Amazing results from the beginning, Congrats guys!!!
I would like my little idea to improve the results. Months ago I added an indicator to the library. I think this indicator can prevent fake entries, basiclly I added two more conditions to the original code:
Acelerate volume conditions1AverageVolumeBuy > AverageVolumeSell and AverageVolumeBuy > 50It is only a little bit improve, and please guys please to share your opinion. I hope you like.
Saludos!!
1 user thanked author for this post.
08/29/2018 at 10:35 PM #79333Why 4 pips? The SP500 spread is never that big.
I forgot, I forgot okay!? We all make mistakes!? 🙂
Also Lot size = 2 on my results above.
S&P500 is min Lot size 5, so more mistakes on my part! 🙁I hope you like.
Yeah looks good, thanks! The more the merrier! 🙂
09/02/2018 at 8:37 AM #7954209/02/2018 at 8:47 AM #7954409/02/2018 at 8:52 AM #7954809/02/2018 at 8:54 AM #7954909/02/2018 at 8:57 AM #7955009/02/2018 at 9:01 AM #79551X I did a 200k test on your code.
Above is for Xusto version with the volume tweak in post 79312.
( @stefanb in case you don’t know and for others … if you select part of the text of a post and THEN click on Quote on the right above the post then the selected text displays as a quote … very useful).
09/02/2018 at 10:10 AM #79557Here is a code that I will start live soon.
Have run it om demo for a while and it seems to be working ok.
Spread=1
Op 75%
EURUSD 5 min12345678910111213141516171819202122232425262728293031323334353637383940414243444546DEFPARAM CumulateOrders = FalseDEFPARAM PRELOADBARS = 200indicator1 = SuperTrend[1,8]c1 = (close <= indicator1)indicator4 = SuperTrend[1,4]c4 = (close <= indicator4)c2 = DIplus[6](close) > DIminus[3](close)HL = 14 // Hour of Long EntryHLS = 12 // Hour of Long ExitHS = 7 // Hour of Short EntryHSS = 15 // Hour of Short ExitLATR = 9// Number of ATRs for Stop LossPATR = 21 // Number of ATRs for Take ProfitATR = 18 // ATR periodIF Hour=HL and c1 THENBUY 1 CONTRACTS AT MARKETENDIFIf LongOnMarket AND Hour=HLS THEN//SELL AT MARKETENDIFIF Hour=HS and c2 and c4 THENSELLSHORT 1 CONTRACTS AT MARKETENDIFIF ShortOnMarket AND Hour=HSS THENEXITSHORT AT MARKETENDIFSET STOP LOSS LATR*AverageTrueRange[ATR](close)SET TARGET PROFIT PATR*AverageTrueRange[ATR](close)IF Hour=HS and c2 and c4 THENSELLSHORT 1 CONTRACTS AT MARKETENDIFIF ShortOnMarket AND Hour=HSS THENEXITSHORT AT MARKETENDIFSET STOP LOSS LATR*AverageTrueRange[ATR](close)SET TARGET PROFIT PATR*AverageTrueRange[ATR](close)2 users thanked author for this post.
09/02/2018 at 10:33 AM #79559Lines 34-35 are duplicate and you may remove them.
Moreover, your SL & TP will change each new candle, while they should not while on market, I think you should use line 44 to write
1If Not OnMarket thenand add line 47 with ENDIF
09/02/2018 at 10:46 AM #79561 -
AuthorPosts
Find exclusive trading pro-tools on