• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 Mykro, Today, 04:58 PM
        0 responses
        2 views
        0 likes
        Last Post Mykro
        by Mykro
         
        Started by edunwa, Today, 04:11 PM
        0 responses
        6 views
        0 likes
        Last Post edunwa
        by edunwa
         
        Started by yeshujbp, Today, 02:40 PM
        0 responses
        7 views
        0 likes
        Last Post yeshujbp  
        Started by Venom, Today, 01:05 PM
        0 responses
        10 views
        0 likes
        Last Post Venom
        by Venom
         
        Started by Dert66, Today, 12:11 PM
        0 responses
        7 views
        0 likes
        Last Post Dert66
        by Dert66
         
        Working...
        X