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

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 swestendorf, Today, 11:14 AM
          0 responses
          1 view
          0 likes
          Last Post swestendorf  
          Started by Sparkyboy, Today, 10:57 AM
          0 responses
          3 views
          0 likes
          Last Post Sparkyboy  
          Started by TheMarlin801, 10-13-2020, 01:40 AM
          21 responses
          3,917 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by timmbbo, 07-05-2023, 10:21 PM
          3 responses
          155 views
          0 likes
          Last Post grayfrog  
          Started by Lumbeezl, 01-11-2022, 06:50 PM
          30 responses
          812 views
          1 like
          Last Post grayfrog  
          Working...
          X