bar counting to help analysing

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #180668 quote
    JOKAMAURICE
    Participant
    Junior

    Hi, I am looking for a bar counting code that would print under each bar its number starting from the beginning of the session. It helps a lot when studying price action. I know it is available on Ninja.

    Thanks in advance.
    Maurice

    #180678 quote
    robertogozzi
    Moderator
    Master

    There you go:

    x = barindex
    drawtext("#x#",barindex,low - range)
    return
    #180681 quote
    JOKAMAURICE
    Participant
    Junior

    Sorry, it does not work

    #180682 quote
    robertogozzi
    Moderator
    Master

    It does work on my platform.
    Did you put it ON your chart (not below)?

    #180683 quote
    JOKAMAURICE
    Participant
    Junior

    Sorry, what do you mean exactly. I have a Dax chart 5 min the I go to indicators and I create a new one. I paste your code and I get the attached picture

    #180692 quote
    JOKAMAURICE
    Participant
    Junior

    I understood what you meant and it works but may I ask a question. How to start the counting lets say at 9 am each day until 11PM for example?

    Because it starts the counting on a 5 min chart on 28 oct.

    Thank a lot for your help.

    #180696 quote
    robertogozzi
    Moderator
    Master

    There you go:

    Once Tally = 0
    If OpenTime = 090000 Then
       Tally = 0
    Endif
    If (OpenTime >= 090000) And (OpenTime <= 230000) Then
       Tally = Tally + 1
       drawtext("#Tally#",barindex,low - range)
    Endif
    return
    choccy_bear thanked this post
    #180699 quote
    JOKAMAURICE
    Participant
    Junior

    A very great thank you.

    #180700 quote
    GraHal
    Participant
    Master

    Link to above code added as Log 309 here …

    Snippet Link Library

    robertogozzi thanked this post
    #180881 quote
    JOKAMAURICE
    Participant
    Junior

    Dear Roberto,

    Your program works beautifully. Just a question if I a may (without abusing of your patience) the position of the figures is quite strange, sometimes very low sometimes very close to the bar. Is there any way to fix some distance below the low of the bar?
    All the best.
    Maurice

    #180884 quote
    robertogozzi
    Moderator
    Master

    There’s no instruction to anchor the text on a fixed point of the chart (it’s in the pipeline, though), but this could help display them at a better distance. Replace line 7 with:

    drawtext("#Tally#",barindex,lowest[5](low) - highest[5](range))

    changing periods (I used 5) from 2 to any number (I suggest it to not be greater than 50) could let you better fine tune the output.

    choccy_bear thanked this post
    #180885 quote
    JOKAMAURICE
    Participant
    Junior

    Thank you, it is a lot better.

    #219244 quote
    choccy_bear
    Participant
    New

    Hi Maurice,

    How did you manage to get this bar count to show on the main chart as opposed to a panel at the bottom?

    I keep having the same issue as you did with it only showing at the bottom of the chart and not on the chart itself.

     

    Thanks

     

    Jay

    #219246 quote
    JOKAMAURICE
    Participant
    Junior

    You have to add it by going on the price menu on the top left of the chart and then add an indicator

    choccy_bear thanked this post
    #219250 quote
    choccy_bear
    Participant
    New

    Thanks for responding, Maurice.

    It embarrasses me to say that it took a lot longer than I expected to figure out how to do it even after you telling me how!

     

    BTW this is great for watching PA in the Al Brooks format.

    Jay

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.

bar counting to help analysing


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 14 replies,
has 4 voices, and was last updated by choccy_bear
2 years, 5 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 10/31/2021
Status: Active
Attachments: 3 files
Logo Logo
Loading...