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

Limiting trade execution to only first time of session, if possible?

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

    Limiting trade execution to only first time of session, if possible?

    Is it possible to limit a trade execution to only happen the first time it appears in a session? For example If using the (current day OHL) indicator and price is below the Open and comes up and touches the open I want to sell short, however if it touches that line again later in the day I do not want the strategy to execute a trade.

    Not sure this is possible if so I have a few different ideas I would like to try. Thanks in advance for any help. Very new to the strategy building.

    #2
    You can do this by creating a bool type variable that would be set True initially. The bool would be part of the entry conditions. When the first entry occurs you can set the bool false so that the entry conditions are no longer true and further touches/crosses would not generate an entry condition. You will want to "reset" the bool to true and you can do this when the condition of First bar of session is true.

    Reference:




    Comment


      #3
      Hi James, thanks for posting. Thank you for the answer too Tasker-182

      I agree with the use of bools that tasker suggested. You can make a boolean variable in the inputs and variables section, defaulted to true. Then you can use it as a flag in your entry condition and set it to false once the condition becomes true e.g.

      Kind regards,

      -ChrisL
      Attached Files
      Chris L.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Trader146, Today, 09:17 PM
      0 responses
      5 views
      0 likes
      Last Post Trader146  
      Started by ttrader23, 05-08-2024, 09:04 AM
      9 responses
      43 views
      0 likes
      Last Post ttrader23  
      Started by ZeroKuhl, Yesterday, 04:31 PM
      8 responses
      46 views
      0 likes
      Last Post ZeroKuhl  
      Started by reynoldsn, Today, 07:04 PM
      0 responses
      11 views
      0 likes
      Last Post reynoldsn  
      Started by puapwr, Today, 06:09 PM
      0 responses
      5 views
      0 likes
      Last Post puapwr
      by puapwr
       
      Working...
      X