Announcement

Collapse
No announcement yet.

Relative Text Study

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

  • Relative Text Study

    I am trying to create a study that places a relative text number below the low of a candlestick at intervals of 10 from the current intraday time bar.

    This is my first study to try to write.

    I have attached my work.

    I would sure appreciate some help to complete it.

    Thanks,
    j l evans
    Attached Files

  • #2
    Hello j l evens,

    The drawing functions you are trying to use are already built into the EFS language. You do not need to declare them in your formula as you have. You can just call them directly from inside main(). To draw the objects at every 10 bars, you will need to declare a global variable outside of main() and set it to 0.

    PHP Code:
    var nCntr 0;

    function 
    main() { 
    Then inside main() check for the bar state of BARSTATE_NEWBAR using getBarState(). When this state is found, increment your nCntr variable by one. Then check for the value of 10. If it is equal to 10, then call the drawing function and reset nCntr back to 0.

    PHP Code:
    var nCntr 0;

    function 
    main() {
        if (
    getBarState() == BARSTATE_NEWBAR) {
            
    nCntr++;
            if (
    nCntr == 10) {
                
    drawTextRelative( ....your parameters....);
                
    nCntr 0;
            }

        return;

    The parameters you were trying to use with the drawTextRelative() function were incorrect. Please review the reference material at the link provided for the proper syntax.

    Since you are new to EFS, you may also want to go through our various help guides and tutorials, which can be found in the Help Guides folder in the EFS KnowledgeBase. If you have limited programming experience or just want to learn more about JavaScript, which is the basis for EFS, please review our Core JavaScript Video Series.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X