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

Indicator reading orders

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

    Indicator reading orders

    Hello,

    I have an indicator that is reading the order from an account and its giving me the "order.LimitPrice"

    But I need to seperate short and long orders.

    Is there a syntax or a logic to have order.LimitPrice"Short" and order.LimitPrice"Long" please?

    When typing in the code then there appears in the NT-popup window only order.LimitPrice.

    Thank you!
    Tony

    #2
    Hello tonynt, thanks for your post.

    The Order object has an OrderAction property, this can be used to tell if the order was a buy or sell.

    Best regards.

    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      yes, you can be of further assistance to me.

      When I code a bracket in the indicator with
      if(Close[0]>order.LimitPrice+ATRticks*TickSize && order.OrderAction==OrderAction.Buy) movelongorder=true;
      if(Close[0]<order.LimitPrice-ATRticks*TickSize && order.OrderAction==OrderAction.Sell) moveshortorder=true;

      will that work (the question is not about the action, I just give the bool here for the logic)? Or might there be a mess when there are short and long orders?

      I´m experiencing strange order handling and I´m not sure if this here makes sense before doing more debugging.

      Thank you!
      Tony

      Comment


        #4
        Hello tonynt, thanks for your reply.

        The code you posted seems ok, but it would take testing in the actual script to confirm this is working for you as expected. Note that the Order object also has a Name property. Giving your orders unique signal names can be helpful for identifying them at a later time.

        Please let me know if you have any questions.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by terofs, Yesterday, 04:18 PM
        1 response
        21 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by CommonWhale, Today, 09:55 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Gerik, Today, 09:40 AM
        2 responses
        7 views
        0 likes
        Last Post Gerik
        by Gerik
         
        Started by RookieTrader, Today, 09:37 AM
        2 responses
        13 views
        0 likes
        Last Post RookieTrader  
        Started by alifarahani, Today, 09:40 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X