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 rhyminkevin, Today, 04:58 PM
      3 responses
      48 views
      0 likes
      Last Post Anfedport  
      Started by iceman2018, Today, 05:07 PM
      0 responses
      5 views
      0 likes
      Last Post iceman2018  
      Started by lightsun47, Today, 03:51 PM
      0 responses
      7 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      14 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      50 views
      0 likes
      Last Post futtrader  
      Working...
      X