Announcement

Collapse
No announcement yet.

Write Hi of Last N Bars On Chart

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

  • Write Hi of Last N Bars On Chart

    Hi Folks,

    I've tried a few times to get a snippet of code to work. Good news, I didn't get any syntax errors, bad news nothing happened.

    What I'm trying to accomplish is put the value of the last two digits on the chart of the previous bars Hi and Low.

    I'm not getting the logic correct of " For I = 0 to N " in Java.

    Here's what I have for the meat of the task

    Y = high(0);
    cc = formatPriceNumber(Y);
    ccL = cc.length;
    ccV = cc.substring(ccL,(ccL-2));
    drawTextRelative(0,high(0)+5,ccV,Color.teal,null,T ext.CENTER,"Calibri",10,0);

    If there is a Java Ace out there who could put this into a loop I'd be very grateful.

    Good Hunting,
    Glenn

  • #2
    Re: Write Hi of Last N Bars On Chart

    Glenn
    In the image enclosed below you can see an example of how you would write above the previous 10 bars the last 2 digits of the corresponding bar's High [note that in this example the loop is executed only at BARSTATE_NEWBAR]
    You can find information on loop statements in this and this article of the Core JavaScript Guide which is available in the EFS KnowledgeBase
    Alex




    Originally posted by fastflyer
    Hi Folks,

    I've tried a few times to get a snippet of code to work. Good news, I didn't get any syntax errors, bad news nothing happened.

    What I'm trying to accomplish is put the value of the last two digits on the chart of the previous bars Hi and Low.

    I'm not getting the logic correct of " For I = 0 to N " in Java.

    Here's what I have for the meat of the task

    Y = high(0);
    cc = formatPriceNumber(Y);
    ccL = cc.length;
    ccV = cc.substring(ccL,(ccL-2));
    drawTextRelative(0,high(0)+5,ccV,Color.teal,null,T ext.CENTER,"Calibri",10,0);

    If there is a Java Ace out there who could put this into a loop I'd be very grateful.

    Good Hunting,
    Glenn

    Comment


    • #3
      Thank You ... Again

      Hi Alexis,

      As I mentioned before, for folks like me, you are our hero !

      Best Regards,
      Glenn

      Comment


      • #4
        Re: Thank You ... Again

        Glenn
        You are most welcome and thank you for the kind words
        Alex


        Originally posted by fastflyer
        Hi Alexis,

        As I mentioned before, for folks like me, you are our hero !

        Best Regards,
        Glenn

        Comment

        Working...
        X