Check for odd numbers

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #157145 quote
    Grantx
    Participant
    Average

    How do I skip odd numbers (or evens) in the following code:

    //04.01.2021
    //Grantx
    
    //vertical offset to draw text correctly over horizontal lines
    Voffset = 1.2*pipsize
    
    DRAWTEXT(IntradayBarIndex, barindex, high+Voffset, Dialog,Standard, 20) COLOURED(255,255,255)
    
    
    RETURN
    
    #157146 quote
    Vonasi
    Moderator
    Master

    Use MOD.

    MOD

    Grantx thanked this post
    #157156 quote
    Grantx
    Participant
    Average

    Thanks for your reply. How though? How do I filter odds using MOD? documentation doesnt say much..

    #157159 quote
    robertogozzi
    Moderator
    Master
    EvenNumber = ((Number MOD 2) =0)
    OddNumber  = ((Number MOD 2) =1)

    only one of the two variables can be true each time.

    Grantx thanked this post
    #157199 quote
    Grantx
    Participant
    Average

    Thanks that works.

    Is there a way to be able to change the colour and size of those numbers by using the indicator settings panel? ie not having to change the code.

    #157201 quote
    robertogozzi
    Moderator
    Master

    No, there’s no way. You can’t use variables so you’ll have to change the code.

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

Check for odd numbers


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Grantx @grantx Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by robertogozzi
5 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/09/2021
Status: Active
Attachments: No files
Logo Logo
Loading...