in Search

Count Back

Last post 06-18-2009, 15:41 by wblam. 3 replies.
Sort Posts: Previous Next
  •  06-17-2009, 10:47 29929

    Count Back

    How to code a bar count back on a indicator to the next signal. When use barssince(Ind1), the bar count is forward but how to do a bar count back rather than count forward?

  •  06-17-2009, 16:12 29933 in reply to 29929

    Re: Count Back

    barssince(Ind1)-barssince(nextsignal)
  •  06-18-2009, 11:06 29940 in reply to 29933

    Re: Count Back

    Hi Wblam,

    There is just 1 indicator so how do you define the nextsignal? Barssince count the bars forward when there is a signal occurence but is possible to to do the opposite? When there is a signal count bar backward to previous signal.

  •  06-18-2009, 15:41 29941 in reply to 29940

    Re: Count Back

    hi Flexi ,


    Difference between 3 and 7 is 7-3
    Difference between -3 and -7 is (-7) - (-3)
    therefore the Barssince count forward or backward is not important here.
    How to define the next signal? You should tell us.
    Can you post your formula and tell us what signal you want?

    or you may try :

    valuewhen(1,defination of signal, cum(1))-valuewhen(2,defination of signal, cum(1))
View as RSS news feed in XML