I am still using strategy builder with the current strategy I'm trying to build but I want to add that I have nothing against using the unlocked code in NinjascriptEditor.
I am using the Exit methods in the order management of my strategy for submitting a Stop-Loss and Take-Profit price level. Those levels both are set according to a plot value of a custom indicator.
In my strategy set, when the condition "Position.MarketPosition=MarketPosition.Long" is true I am executing those actions to fulfill this task:
ExitLongLimit(DefaultQuantity, myIndicator(Close, Convert.ToString(end.TimeOfDay)).MyHigh-One[0], @"TakeProfit", "");
The particular unlocked code for that set is:
// Set 3 if (Position.MarketPosition == MarketPosition.Long) { ExitLongStopMarket(Convert.ToInt32(DefaultQuantity ), myIndicator.MyLow-One[0], @"StopLoss", ""); ExitLongLimit(Convert.ToInt32(DefaultQuantity), myIndicator.MyHigh-One[0], @"TakeProfit", ""); }
is that the user should be able to choose as user input which low and high level he likes to use. For example, if the user makes the choice "Level 3" than the condition rule for the action should be:
ExitLongLimit(DefaultQuantity, myIndicator(Close, Convert.ToString(end.TimeOfDay)).MyHigh-Three[0], @"TakeProfit", "");
Thank you.
Patricia.
Comment