En utilisant la fonction CumulateOrders =true, je souhaite néanmoins limiter à par exemple 2 le nombre de shares à engager en buy ou sellshort. Avez vous une solution à m’apporter à coder?
Il y a un exemple dans chacune des 2 instructions:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
myMACD=MACD[12,26,9](close)
short=myMACDcrosses under0
//first order
IFNOTShortOnMarketANDshortTHEN
SELLSHORT1CONTRACTSATMARKET
ENDIF
MAXSHARES=COUNTOFSHORTSHARES<5
//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
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok