Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawObject in multi series

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

    DrawObject in multi series

    Hi,
    I've done the following. Compiled successfully then I realized that the first DrawRectangle was plotted from the point I desired but not the second DrawRectangle.The worst case was my DrawRegion not even plotted. I must have made some mistakes. Your kind advice will be much appreciated! (My primary series is 6E 12-10 2 Renko and the secondary series is 6E 12-10 6 Renko)


    Variables

    private DataSeries Hiline0000;
    private DataSeries Loline0000;

    protected override void Initialize()
    {
    AddRenko("6E 12-10", 6, MarketDataType.Last);

    Hiline0000 = new DataSeries (this);
    Loline0000 = new DataSeries (this);
    }

    private DateTime startDateTime000a;
    private DateTime endDateTime000a;

    private DateTime startDateTime000b;
    private DateTime endDateTime000b;

    protected override void OnBarUpdate()
    {
    if(BarsInProgress ==0)
    {
    startDateTime000a = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 8, 00, 0);

    int startBarsAgo000a = GetBar( startDateTime000a);

    double hh1a = High[startBarsAgo000a];
    double ll1a = Low[startBarsAgo000a];

    DrawRectangle("Reg01", false, startBarsAgo000a, hh1a, 0, ll1a, Color.Khaki, Color.Khaki, 4);
    }


    if(BarsInProgress ==1)
    {
    startDateTime000b = new DateTime(Times[1][0].Year, Times[1][0].Month, Times[1][0].Day, 8, 00, 0);

    int startBarsAgo000b = GetBar( startDateTime000b);

    double hh1b = Highs[1][startBarsAgo000b];
    double ll1b = Lows[1][startBarsAgo000b];

    DrawRectangle("Reg01b", false, startBarsAgo000b, hh1b, 0, ll1b, Color.Khaki, Color.Khaki, 4);


    double hi0000 = (SUM(Highs[1],startBarsAgo000b)[0])/startBarsAgo000b;
    double lo0000 = (SUM( Lows[1],startBarsAgo000b)[0])/startBarsAgo000b;

    Hiline0000.Set (Instrument.MasterInstrument.Round2TickSize(hi0000 ));
    Loline0000.Set (Instrument.MasterInstrument.Round2TickSize(lo0000 ));

    DrawRegion("Reg0000a", startBarsAgo000b, 0, Hiline0000, Loline0000, Color.Transparent, Color.Pink, 5);
    }


    }
    Attached Files

    #2
    K.SATO, you would need to add some prints to check the values you calculate for the variables you pass into the second rectangle and the draw region, this should give you an idea where things might be off from what you expect them to be.

    Comment

    Latest Posts

    Collapse

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