Jim-Boulder
07-03-2007, 06:22 AM
When an existing ATM strategy is called within a Ninja Script strategy which is set to Update OnBarClose=True, does the ATM strategy operate in tick x tick mode or in 'bar' mode?
Specifically, if the ATM strategy called contains a 3-level stop-loss scheme, does it operate in tick x tick basis if called from a strategy operating in OnBarUpdate mode?
NinjaTrader_Ray
07-03-2007, 07:27 AM
An ATM strategy always operate on real-time market data events...so tick by tick.
luxurious_04
08-19-2010, 03:50 AM
How to call ATM strategy in a ninja script? Any help for this problem
NinjaTrader_Bertrand
08-19-2010, 06:00 AM
Please see this link here for more info - http://www.ninjatrader-support.com/HelpGuideV6/UsingASMStrategies.html
A complete coding example can be found in the per default installed 'SampleAtmStrategy' in NinjaTrader.
luxurious_04
08-26-2010, 12:11 AM
Anyone there that could me in this problem. I already build an ATM strategy template in the Super Dom and then I want to call this into my ninja script strategy. But when I tried to backtest this strategy it will worked properly. Here is my code below:
if (CrossAbove(SMA(SMA1), SMA(SMA2), 1))
{
if (orderIdL.Length == 0 && atmStrategyIdL.Length == 0)
{
atmStrategyIdL = GetAtmStrategyUniqueId();
orderIdL = GetAtmStrategyUniqueId();
orderBarL = CurrentBar;
AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Market, 0, 0, TimeInForce.Day, orderIdL, "CL_Scalp", atmStrategyIdL);
}
}
else if (CrossBelow(SMA(SMA1), SMA(SMA2), 1) )
{
if (orderIdS.Length == 0 && atmStrategyIdS.Length == 0)
{
atmStrategyIdS = GetAtmStrategyUniqueId();
orderIdL = GetAtmStrategyUniqueId();
orderBarS = CurrentBar;
AtmStrategyCreate(Cbi.OrderAction.Sell, OrderType.Market, 0, 0, TimeInForce.Day, orderIdS, "CL_Scalp", atmStrategyIdS);
}
}
Thanks in advance....
NinjaTrader_Bertrand
08-26-2010, 02:54 AM
Let's continue in your other thread on the same issue, thanks.