Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawDot causing a problem

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

    DrawDot causing a problem

    Hi,

    I have an indicator looking for a condition which appears to be working as I have the if statement followed by a print which when the if statement is true I am seeing the correct output as per the code below;

    Code:
    This is when the code was working correctly;
    if (BarsInProgress == 0)
    {
    if (GetCurrentBidVolume(0) > GetCurrentAskVolume(1))
    print(GetCurrentBidVolume(0) + " " + GetCurrentAskVolume(1))
    }
    However when I have attempted to add a DrawDot after the condition as well I am seeing a problem. The problem is the print output is now printing everything in the print statement even when the condition is not true. What could be causing this?

    Code:
    if (BarsInProgress == 0)
    {
    if (GetCurrentBidVolume(0) > GetCurrentAskVolume(1))
    print(GetCurrentBidVolume(0) + " " + GetCurrentAskVolume(1))
    DrawDot("Plot0", false, 0, High[0] + 1, Color.WhiteSmoke);
    }
    Appreciate the help.

    #2
    suprsnipes, you extended your if ( ) condition beyond using a single line, so you would need to use the { } braces around it -

    Code:
    if (BarsInProgress == 0)
    {
    if (GetCurrentBidVolume(0) > GetCurrentAskVolume(1))
     {
       print(GetCurrentBidVolume(0) + " " + GetCurrentAskVolume(1))
       DrawDot("Plot0", false, 0, High[0] + 1, Color.WhiteSmoke);
     }
    }

    Comment


      #3
      Could you please confirm that for DrawDot etc there is no need to use Add() in the Initialize section?

      Comment


        #4
        Correct, that's not need to work with DrawDot() per se, only if you would want to add

        a) bars series for programmatic access
        b) indicators for display in strategies
        c) adding a plot / line (which does not relate to the drawing methods)

        Comment


          #5
          Appreciate it your quick response as always, thanks

          Comment

          Latest Posts

          Collapse

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