Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Overall Market Position

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

    Overall Market Position

    Hello,

    I am using Positions[0].MarketPosition to check the current Market Position for the first instrument, but this value checks only current strategy position and not the real one.
    So, after a restart and if a position is open (for whatever reason) it doesn’t check the real Market Position.
    So now, I have a position opened, I can see it on Positions window but my strategy cannot take proper actions. Is there any other way to check the overall Market Position?

    Thank you

    #2
    Hi jbesada, that would be unfortunately expected - the strategy script can only access the individual strategy market position - it would not be supported to access the position of the account the script would run on, this is on our feedback list for consideration though - I've added your vote in here as well.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi jbesada, that would be unfortunately expected - the strategy script can only access the individual strategy market position - it would not be supported to access the position of the account the script would run on, this is on our feedback list for consideration though - I've added your vote in here as well.

      This is surprising! I really like using ninjatrader for backtesting but I find this issue to be very dangerous, and at the least very inconveniencing. I used to program in other platforms and there were ways to get info on all open orders in the account that existed before the strategy was started, and to pull their OrderID and manipulate them (close them, assume general control and monitor them).

      Please, I would urge the developers to create a way to check from the strategy if the account is holding any position at all, and to control those positions. I am using a multiple daily bar strategy, and I won't want my position wiped out if the computer accidentally powers off, or I accidentally hit Reload Ninjascript on the chart window.

      Thanks

      Comment


        #4
        Thank you for your feedback and suggestions. We value your opinions and they will be considered in our feature discussion for a future NinjaTrader release.

        I have documented this case as a feature request and as soon as we have a tracking ID for this particular request, we will update this thread.

        Please let me know if there is anything else I can do for you.
        MatthewNinjaTrader Product Management

        Comment


          #5
          100% agree with RunnrX. I think it is completely necessary have control of positions of the real account.

          Thank you

          Comment


            #6
            Thank you for your suggestion for the improvement of NinjaTrader. I have submitted it into our tracking system with the unique ID #776.
            MatthewNinjaTrader Product Management

            Comment


              #7
              Originally posted by NinjaTrader_Matthew View Post
              Thank you for your suggestion for the improvement of NinjaTrader. I have submitted it into our tracking system with the unique ID #776.

              Thank you! If this feature gets added in to the next version, or just even a minor patch, I would be your friend for life.

              With the way things are, I can only rely on the strategies I code to be backtest examples, and to only run short term intraday trading systems.

              For a daily bar, multi-day system I just spent 25 hours coding, it won't work with Ninjatrader automatically because every time the computer gets turned off at night the strategy will lose track of the fact that there was a working buy stop order that needs to be updated with a lower stop price on each day's close, or it will forget that there's an already open position to monitor for exit signals, and the open position will just run wild and unattended to.. so I would literally have to do all the trading manually in this case after all, with at least the help of the strategy showing me where it would enter and exit, even if it's not actually executing the orders anymore.

              It's been a while since I programmed in metatrader 4, or this ForexTester backtesting program, but I was sure that they had a coding method that could detect all open orders in the account and get their information, something like this (rough code example, not correct syntax, just making up method names from memory from 2 yrs ago, etc)


              int NumberOfOpenOrders = GetTotalOrders() // returns an integer of how many open orders exist in your account

              for (i=0; i < NumberOfOpenOrders; i++)
              Array[i] = GetOrderID(i);

              OrderIWantToClose = GetOrderType(Array[3])

              So the strategy could get the IDs of all existing open orders that were opened before the strategy started and assume control over managing and closing them.

              Or, something like this was also possible

              private IOrder EntryOrder = GetOrderID(0); if there was only one open order at the time


              I know the code I wrote probably has logic errors, but you know what I'm trying to say..

              if that could be added to NinjaTrader, then it would be a truly automated trading platform that I could use to swing trade stocks for days and weeks with peace of mind, and like I said, I would be your friend forever

              Thanks for reading this

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              646 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              367 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              107 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              569 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              573 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X