Im using unmanaged approach and I need to place Stop orders with StopLoss and Take Profit.
My code is:
IsUnmanaged=true;
SetProfitTarget(contador.ToString(),CalculationMod e.Price,Close[0]+0.0030);
SetStopLoss(contador.ToString(),CalculationMode.Pr ice,Close[0]-0.0060,false);
SubmitOrderUnmanaged(0,OrderAction.Buy,OrderType.S topMarket,10000,0,Close[0]+0.0030,contador.ToString());
I have this error: Strategy 'MyCustomStrategy': Error on calling 'OnBarUpdate' method on bar 1: Strategy 'MyCustomStrategy/206666248': Method 'SetProfitTarget' can't be called on unmanaged strategies.
Can you help me on place StopLoss and Profit Target?
Thank you!
Comment