Forums › ProRealTime English forum › ProOrder support › Confirmation of Trend using Neural Networks (by kind permission of Leo) › Reply To: Long only trading with trend confirmation on 5 minutes timeframe
08/24/2018 at 3:28 PM
#78967
Here’s the latest version v1.1! Rock on Leo … keep em coming!!! 🙂
Almost 4 x Profit by adding an exit filter! I had to double check to make sure I had Tick by Tick selected!!! 🙂
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
//https://www.prorealcode.com/topic/interesting-web-pages-or-blogs/ //Variables: DEFPARAM CUMULATEORDERS = False candlesback=5 ProfitRiskRatio=2 spread=1.5 myATR=average[20](range)//+std[20](range) ExtraStopLoss=MyATR //ExtraStopLoss=3*spread*pipsize classifier=0 //for long trades FOR scan=1 to candlesback DO IF classifier[scan]=1 then BREAK ENDIF LongTradeLength=ProfitRiskRatio*(close[scan]-(low[scan]-ExtraStopLoss[scan])) IF close[scan]+LongTradeLength < high-spread*pipsize then IF lowest[scan+1](low) > low[scan]-ExtraStopLoss[scan]+spread*pipsize then classifier=1 //candleentry=barindex-scan BREAK ENDIF ENDIF NEXT IF classifier=1 and close > Average[60](close) then Buy 2 Contracts at Market //DRAWSEGMENT(candleentry,close[barindex-candleentry],barindex,close[barindex-candleentry]+LongTradeLength) COLOURED(0,250,0) //DRAWELLIPSE(candleentry-1,low[barindex-candleentry]-ExtraStopLoss,barindex+1,high+ExtraStopLoss) COLOURED(0,250,0) ENDIF // If Close < Average[400](close) Then Sell at Market endif SET TARGET PPROFIT 100 SET STOP PLOSS 100 |