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
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue