Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

ATM Strategy is getting overriding

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ATM Strategy is getting overriding

    Hi ,

    When ever my strategy place ATM order with one Template = ATM_TemplateName1 and other strategy places order with different template Template = ATM_TemplateName2 .

    As these strategies are running in diff Sim account SIM101 and SIM102 . But when order is placed in SIM102 with ATM_TemplateName2 previously placed order with ATM_TemplateName1 in SIM101 will be overritten by ATM_TemplateName2 in SIM101 . I don't don't want this to happen SIM101 should work with ATM_TemplateName1 and SIM102 hould work with ATM_TemplateName2
    How i can achive this?

    AtmStrategyCreate(OrderAction.Buy, OrderType.Limit, longLimitPrice, lstop-1, TimeInForce.Day, orderId, ATM_TemplateName1, atmStrategyId, (atmCallbackErrorCode, atmCallBackId) => {
    //check that the atm strategy create did not result in error, and that the requested atm strategy matches the id in callback
    if (atmCallbackErrorCode == ErrorCode.NoError && atmCallBackId == atmStrategyId)
    isAtmStrategyCreated = true;
    });

    AtmStrategyCreate(OrderAction.Buy, OrderType.Limit, longLimitPrice, lstop-1, TimeInForce.Day, orderId, ATM_TemplateName2, atmStrategyId, (atmCallbackErrorCode, atmCallBackId) => {
    //check that the atm strategy create did not result in error, and that the requested atm strategy matches the id in callback
    if (atmCallbackErrorCode == ErrorCode.NoError && atmCallBackId == atmStrategyId)
    isAtmStrategyCreated = true;
    });

    #2
    Hello shankar.deshapande,

    From the given code I would not be certain what the problem is. Have you tried to make a copy of the SampleATMStrategy and modify it to use your template? You could then make a second copy pointing to the second template to further test. If you can see a problem using that sample then we could take a look at the situation with the steps you provide to see the problem.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by f.saeidi, Today, 12:11 AM
    0 responses
    3 views
    0 likes
    Last Post f.saeidi  
    Started by Graci117, Yesterday, 11:40 PM
    0 responses
    5 views
    0 likes
    Last Post Graci117  
    Started by BIOK.NT, Yesterday, 01:56 PM
    2 responses
    11 views
    0 likes
    Last Post BIOK.NT
    by BIOK.NT
     
    Started by i2ogu3, Yesterday, 11:31 PM
    0 responses
    4 views
    0 likes
    Last Post i2ogu3
    by i2ogu3
     
    Started by RDTrader16, Yesterday, 10:19 PM
    0 responses
    10 views
    0 likes
    Last Post RDTrader16  
    Working...
    X