Announcement

Collapse
No announcement yet.

Test only CURRENT BAR

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

  • Test only CURRENT BAR

    is there a way to limit the testing to ONLY today's Bar?
    eg.
    var nState = getBarState():
    if (nState == BARSTATE_NEWBAR) {
    ...
    only execute code once ie. on today's bar.
    no historical bars will be tested.

    }

    is this possible...i'm using the testing to screen for candidates in a PnF chart...

    thanks,
    peter.

  • #2
    Re: Test only CURRENT BAR

    peter
    You can do that by adding a check for getCurrentBarIndex() to be equal to 0 or for isLastBarOnChart()
    Alex


    Originally posted by peterjerome
    is there a way to limit the testing to ONLY today's Bar?
    eg.
    var nState = getBarState():
    if (nState == BARSTATE_NEWBAR) {
    ...
    only execute code once ie. on today's bar.
    no historical bars will be tested.

    }

    is this possible...i'm using the testing to screen for candidates in a PnF chart...

    thanks,
    peter.

    Comment


    • #3
      NEWBAR

      thank you alex...that's works perfectly.
      peter.

      Comment


      • #4
        Re: NEWBAR

        peter
        My pleasure
        Alex


        Originally posted by peterjerome
        thank you alex...that's works perfectly.
        peter.

        Comment

        Working...
        X