Hi,
Hoping someone knows a work around for this. Am running a strategy that can take up to 2 positions, so I set CumulateOrder to True and Max Position to 2 x N contracts. No issues back testing however, when I go to launch in production I get an error saying CumulateOrder not compatible with $LOSS stops or $PROFIT targets. The strategy uses a $Loss stop, as well as a %Loss.
Does anyone know of any workaround for this please?
Thanks very much
I got this piece of code from Robo Futures Trader (one of the best sites – check it out) and it comes surprisingly close, but I’d still like to use $LOSS with CumulativeOrders. Appreciate any ideas to try, thank you
stoplimit=70
atrvalue = AverageTrueRange[20](close)
atrstopv = 40*atrvalue
if atrstopv>stoplimit then
atrstop = stoplimit
else
atrstop = atrstopv
endif
set stop ploss atrstop
You should convert the currency amount in a percentage or pips.
I you have a 1K amount you can convert to % with this snippet:
CurrencySL = 1000
PerCentSL = (CurrencySL * 100 / close) / PipValue
SET STOP %LOSS PerCentSL
to convert it to Pips:
CurrencySL = 1000
PipsSL = (close * ((CurrencySL * 100 / close) / PipValue) / 100) / PipSize
SET STOP pLOSS PipsSL
I did not test them, though.
Grazie mille Roberto! Will give that a try