Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Prior Bar High Or Low OCO Order

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

    #16
    Compilation Errors

    Josh,

    As you have guessed I am a newbie at Ninja Script. I do have some experience on TradeStation Easy Language. None with C#. Help!


    I am getting compilation errors on "GetATMStrategyUniqueId". When I go to the docs for this thing it says I am suppose to

    Examples
    protected override void OnBarUpdate()

    { string orderId }.

    I put this into the attached an with "Unknown" for the string. I got more errors.

    Query

    Do I have to add Protected override void OnBarUpdate() on each command or just the section dealing with ATM strategies?

    What is this unique ID and how do I get rid of these errors.

    Thanking you in advance.

    jstockman
    Attached Files

    Comment


      #17
      Hi jstockman

      Your error is because you capitalized some of the letters. It is not "GetATMStrategyUniqueId()" it is "GetAtmStrategyUniqueId()". The "tm" in "Atm" are not capitalized.

      The OnBarUpdate() is the section in which you want to put your logic. You don't put it on every entry condition. Whatever is inside the OnBarUpdate() is the algorithm that NinjaTrader will run through every time a bar is updated. It will start from the top and run through till the end of OnBarUpdate(). Does that make sense?
      Josh P.NinjaTrader Customer Service

      Comment


        #18
        Originally posted by Josh View Post
        Hi jstockman

        Your error is because you capitalized some of the letters. It is not "GetATMStrategyUniqueId()" it is "GetAtmStrategyUniqueId()". The "tm" in "Atm" are not capitalized.

        The OnBarUpdate() is the section in which you want to put your logic. You don't put it on every entry condition. Whatever is inside the OnBarUpdate() is the algorithm that NinjaTrader will run through every time a bar is updated. It will start from the top and run through till the end of OnBarUpdate(). Does that make sense?
        Josh,

        Thank-you. I guess NT needs to clean up its docs. This is a copy job from the AtmStrategyCreate() under the help menu

        // Check for valid condition and create an ATM Strategy
        if (Close[0] > SMA(20)[0])
        AtmStrategyCreate(Action.Buy, OrderType.Market, 0, 0,
        TimeInForce.Day, GetATMStrategyUniqueId(), "MyTemplate",
        GetAtmStrategyUniqueId());


        By the by, the code did compile. Thank-you again

        jstockman

        Comment


          #19
          Thanks for pointing out the typo in the DOC.
          RayNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          627 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          359 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          562 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X