• 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

One trade per "event".

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

    One trade per "event".

    Breaking my brain on this-help please.
    In Strategy Builder (NT8), I created the signal: Go long when price crosses above HULL50, then (within a lookback period of 10) drops to touch the HULL30. What I can't figure out is how to do, is make the strategy stop trading after (X) amount of trades. Then, after a Short position has triggered and closed (after same (X) amount of trades), a long position can be triggered again. Make sense? BTW - I am trading intra-day so a simple "bars since exit" doesn't seem to work here.
    Thanks in advance...

    #2
    Hello White Fork,

    Thanks for your post and welcome to the NinjaTrader forums!

    To accomplish one trade per event you can create a bool variable that flip-flops between events. A bool is a variable that can only be true or false.

    For example, using pseudo code:

    if (crossabove event and bool is false)
    place long trade
    set bool to true // this will prevent a reentry in the cross above and prepares for
    crossbelow

    if (crossbelow event and bool is true)
    place short trade
    set bool to false// this prevent a reentry in the cross below and prepares for
    crossabove

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Perfect, thank you Paul.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by swcooke, Today, 09:20 AM
      5 responses
      14 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by chartish, Today, 08:21 AM
      2 responses
      8 views
      0 likes
      Last Post chartish  
      Started by xbionicx, Today, 01:12 AM
      4 responses
      18 views
      0 likes
      Last Post xbionicx  
      Started by NinjaCustomer, Today, 07:52 AM
      2 responses
      6 views
      0 likes
      Last Post NinjaCustomer  
      Started by tradr, Today, 07:45 AM
      2 responses
      10 views
      0 likes
      Last Post tradr
      by tradr
       
      Working...
      X