Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawTextFixed doesn't update?

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

    DrawTextFixed doesn't update?

    Hi, I am trying to use DrawTextFixed simply just to show blue text if ema8 above 20 and red text if otherwise.

    But, it doesn't seem to update when new bar starts.

    How can I make it update? Here is the snippet

    str = "";
    str =
    "\n\nEMA8 above EMA20 = " + " #######";
    if( EMA(Close,8)[0] >= EMA(Close,20)[0] ) note3Color = Color.Blue;
    else note3Color = Color.Red;
    DrawTextFixed(
    "BottomLeft", str, note3Location, note3Color, note3Font, Color.Transparent, Color.Transparent, 0);

    #2
    ssg10, seems to work in my quick test here on the ES 09-11 10 second chart - what COBC setting do you use with the indicator?

    Comment


      #3
      What is COBC?

      Comment


        #4
        Another funny thing is I just print something simple, like close[0], but the log is wrong:

        Output:

        slopeEMA20=0.0476
        slopeEMA50=0.0196
        stoch=77.7778
        close =1165.5 ====> this should be 1175 on the chart (10sec, ES)


        Code:

        protected override void OnBarUpdate() {

        if ( CurrentBar > 1 ) return;

        string str=""; int i = 0;

        double slopeEMA20 = Slope(EMA(20), 1, 0);
        double slopeEMA50 = Slope(EMA(50), 1, 0);
        Print("slopeEMA20=" +slopeEMA20.ToString("N4"));
        Print("slopeEMA50=" + slopeEMA50.ToString("N4"));
        Print("stoch=" + Stochastics(3,14,3).K[0].ToString("N4"));
        Print("close ="+Close[0]);

        Comment


          #5
          Alright, I found the problem. I am using existing indicator to add my own stuff.. and this line prevents the code flow:

          if ( CurrentBar > 1 ) return;

          Got it. Thanks!

          Comment


            #6
            COBC would be short for the CalculateOnBarClose setting - glad to hear you could resolve your issue.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            331 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            549 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            549 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X