Forums › ProRealTime English forum › ProOrder support › [beta-testing] multi timeframe support for automatic trading, ideas are welcome! › Reply To: [beta-testing] multi timeframe support for automatic trading, ideas are welcome!
07/24/2018 at 8:31 AM
#76568
Only just noticed this Topic again, sorry.
I got it to run after making lots of changes to overcome error messages (most were – you can’t use same variable name under two Timeframes) … use this site to compare your code version to mine.
But the code still doesn’t execute any trades. I reckon you may have too many conditions that are not coincident so no Trades??
I’ll let you know if I get it going later.
Edit / PS
Yeah, I GRAPH Signal and it doesn’t occur at all, more in a few mins! 🙂
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 |
// Définition DEFPARAM CumulateOrders = False DEFPARAM FLATBEFORE = 090000 DEFPARAM FLATAFTER = 120000 TIMEFRAME(default) haclose=(open+close+low+high)/4 haopen=(haopen[1]+haclose[1])/2 sto = Stochastic[5,3](close) myAverage=Average[3] Signal= (haclose>haopen) and (sto>sto[1]) and (sto<80) and sto CROSSES OVER myaverage TIMEFRAME(5 minutes) haclose5=(open+close+low+high)/4 haopen5=(haopen[1]+haclose[1])/2 sto5 = Stochastic[5,3](close) bull5=(haclose5>haopen5) and (sto5>sto[1]) and (sto<80) TIMEFRAME(15 minutes) haclose15=(open+close+low+high)/4 haopen15=(haopen[1]+haclose[1])/2 sto15 = Stochastic[5,3](close) bull15=(haclose15>haopen15) and (sto15>sto[1]) and (sto<80) if bull5 and bull15 and signal then buy at market endif // Closedafault TIMEFRAME(default) sto = Stochastic[5,3](close) IF sto CROSSES OVER 80 THEN SELL AT MARKET ENDIF // Stops SET STOP pLOSS 15 |