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

counter bar from one signal

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

    counter bar from one signal

    Hello and Happy New Year to all!

    In my strategy I have a problem I try to describe it:

    If (condition A generates an input signal) then buy;
    but the break out of condition A create a signal to get short that can occur both after 2 or after 20 candles ..
    I attach a picture to clarify ...
    any ideas?

    Thanks in advance!
    Attached Files

    #2
    Hello bergimax,

    Thank you for your post.

    Correct me if I am wrong here, but I believe you are looking for a way to count the bars since entry. You can use BarsSinceEntry() to achieve this.

    For information on BarsSinceEntry() please visit the following link: http://www.ninjatrader.com/support/h...sinceentry.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      i looking for a counter between the two signal..

      Comment


        #4
        Hello bergimax,

        Thank you for your response.

        You can use something like the following:
        Code:
        if(SignalA)
        myIntBarCount = CurrentBar;
        
        if((CurrentBar - myInBarCount) > 5)
        // Do something
        For information on CurrentBar please visit the following link: http://www.ninjatrader.com/support/h...currentbar.htm

        Please let me know if I may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rbeckmann05, Yesterday, 06:48 PM
        1 response
        12 views
        0 likes
        Last Post bltdavid  
        Started by llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        15 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Working...
        X