I'm using an automated strategy and (for example) enter a long position through the following statement:
EnterLong("MyLongOrder", CalculationMode.Price, dCurrentMarketPrice);
I don't set an immediate stoploss but want to set the stoploss after price has hit a specific level.
I want to use:
SetStopLoss("MyLongOrder", CalculationMode.Price, dEntryPrice, false);
How would I accomplish this?
I am using CalculateOnBarClose = false
So I was thinking I have to check if the "MyLongOrder" position is not null and then set the stop loss. I dont know how to check for this state.
Another option, I don't know if this is possible, is to use some kind of stop on SetStopLoss, so only set the stoploss once a certain price has been triggered. Does some method like SetStopLoss(....,....,...., stopprice) exist?
Thanks
Comment