Hi guys, when venturing into the point where you want to add more positions to your trade automatic, please remember to set “defparam cumulateorders=true” otherwise you might use 1 hour- like me, wondering why it does not work. This is just the example from the documentation.
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
defparamcumulateorders=TRUE
myMACD=MACD[12,26,9](close)
long=myMACDcrosses over0
exit=myMACDcrosses under0
//first order
IFNOTLongOnMarketANDlongTHEN
BUY1CONTRACTSATMARKET
ENDIF
IfLongOnMarketANDexitTHEN
SELLATMARKET
ENDIF
ind=0
//let's add another order while price continue to get higher (more than 10 points) than the last order taken with a condition of 5 bars elapsed since then