Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing and managing position information

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

    Accessing and managing position information

    I would like to create an indicator that would monitor position information. It should be able to find position information for current symbol and how many pending orders are opened. In the case of an open position that does not have at least one order pending after certain amount of time it should close such position.

    Can somebody point me to an example of such code. I am using the NTConnect DLL and I would like to have a safety measure thru NT in case of an error in the code that is generating the orders. Any help greatly appreciated.

    Thanks,
    Moscu

    #2
    moscu,

    NinjaScript Indicators do not have position information at all. Please clarify what you are attempting. Thank you.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      moscu,

      NinjaScript Indicators do not have position information at all. Please clarify what you are attempting. Thank you.
      Then I would need a strategy that can monitor the position and be able to find and count how many open orders are there for the position. If this number is less than 1 then it needs to create on trailing order or close the position with a market order.

      Moscu

      Comment


        #4
        moscu,

        Please keep in mind when you are making your strategy that strategies can only monitor their own strategy position and not the account position.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks,

          I did notice this even though it seemed to me that I could access position information thru method:
          "protected override void OnExecution(IExecution execution)"

          I think it will be helpful for anybody with a ATM strategy to be able to access position information beyond what the strategies generate. It should be added to NT7 features. It would be help me to have a backup Strategy in case to the other failing. There are two many things that can failed such data connection, programming errors, hardware failure.
          With this feature I could run my broker program in a second computer with a second NT monitoring position information. So in the case of any errors in the server generating the reqular orders I would have a backup.

          Thanks,
          Moscu

          Comment


            #6
            Moscu, this is correct, but the issue here is - strategies generally do not cross communicate with eachother. User worked around this via for example txt files or a Global Variable Dll.

            NinjaTrader 7 will offer new methods for accessing account related info (depending on the connected provider and what they offer through their API).
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              Moscu, this is correct, but the issue here is - strategies generally do not cross communicate with eachother. User worked around this via for example txt files or a Global Variable Dll.

              NinjaTrader 7 will offer new methods for accessing account related info (depending on the connected provider and what they offer through their API).
              Thanks Bertrand I guess I will have to wait thill NT7.

              Moscu

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CortexZenUSA, Today, 12:53 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              5 views
              0 likes
              Last Post usazencortex  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              168 responses
              2,265 views
              0 likes
              Last Post sidlercom80  
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              12 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X