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

Did Position in Strategy Change?

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

    Did Position in Strategy Change?

    The docs seem to be the same: https://ninjatrader.com/support/help...l?position.htm

    But all my strategies that used Position won't compile since upgrading to the latest version. Position is now a function that takes an index? It might just be a namespace collision or something. Please advise.

    #2
    Also: it would be nice if the docs would list the namespaces that things belonged to. A stretch goal of that would be the NInjaScript editor offering resolutions to missing types that it knows are provided by NinjaScript. Like IExecution, I still haven't found what namespace that lives in and Visual Studio can't resolve it and it's not in the docs.

    Comment


      #3
      Hello andrewmac,

      Thanks for your post and welcome to the NinjaTrader forums!

      When used in a single time frame or single series strategy you should be able to use Position as shown in the helpguide. If you have multiple time frames or series you would need to use Positions[n].

      Please post a short example strategy that demonstrates the issue requiring Position to be Positions[n] and the steps to recreate the error.

      Paul H.NinjaTrader Customer Service

      Comment


        #4
        Thanks for the response.

        Hmm I just tried using Position on my computer at work and it works fine. I will check on it again in a few hours when I'm on my home PC. It's looking like it's just a namespace collision and the Position I'm referencing in my Strategy at home is a different one than I'm referencing in my test I just did.

        Comment


          #5
          Yeah, I'm dumb, I made an indicator that draws my current position on the chart and I called it Position all sorted now, thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by thanajo, 05-04-2021, 02:11 AM
          3 responses
          467 views
          0 likes
          Last Post tradingnasdaqprueba  
          Started by Christopher_R, Today, 12:29 AM
          0 responses
          10 views
          0 likes
          Last Post Christopher_R  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          166 responses
          2,236 views
          0 likes
          Last Post sidlercom80  
          Started by thread, Yesterday, 11:58 PM
          0 responses
          4 views
          0 likes
          Last Post thread
          by thread
           
          Started by jclose, Yesterday, 09:37 PM
          0 responses
          9 views
          0 likes
          Last Post jclose
          by jclose
           
          Working...
          X