Logic Line-> AtmStrategyChangeStopTarget(0, Low[0] - 3 * TickSize, "STOP1", atmStrategyId);
The "STOP1" I'm assuming is why it won't work correctly IDK. I deleted the STOP1 and just left ( "" ) so that it doesn't send popups on every tick once an order is taken.
It does work like this but if theres a proper way to code this logic would be cool. Kind of tougher to read the Prints: with a thousand error messages.
Also,
I am trying to setup the "ChangeStopTarget" on a strategy without the ATM so that I can backtest and fix errors;
This code is from the SampleATMStrategy on NinjaTrader, I'm trying to setup an Order Entry logic to backtest a couple strategies and I was wondering if anyone familiar with coding knows how to set this up. This line of code is so that the StopLoss and ProfitTarget can be moved around after being placed. Ive tried several times and can't get it to function as expected. thanks in advance
if (atmStrategyId.Length > 0)
{
// You can change the stop price**
if (GetAtmStrategyMarketPosition(atmStrategyId) != MarketPosition.Flat)
AtmStrategyChangeStopTarget(0, Low[0] - 3 * TickSize, "STOP1", atmStrategyId);
}
A standard NinjaScript strategy doesn't have the (atmStrategyId) string and I did try creating a new string to serve as it but it didn't function correctly. I suppose I dont completely understand the backend programming of NinjaScript so that isn't helping me

Comment