Munich, Germany
Experience: Intermediate
Platform: NinjaTrader, TWS
Broker: IB, NinjaTrader Brokerage
Trading: ES,NQ,6E
Posts: 71 since Feb 2010
Thanks Given: 15
Thanks Received: 25
|
I want to draw a zone arround horizontial lines (Pivot's)
and use following code
for (int i = 0; (i < base.Values.Length) && (base.Values[i].Count > 0); i++)
{
double value = base.Values[i][0];
double yH = value + zoneSize * TickSize;
double yL = value - zoneSize * TickSize;
Color colorZone = Plots[i].Pen.Color;
if( colorZone != Color.Transparent )
{
if( zoneShowAll )
{
DrawRectangle(
string.Format( "Zone{0}_{1}", i, CurrentBar ),
false,
Displacement+1,
yH,
Displacement,
yL,
Color.Transparent,
Plots[i].Pen.Color,
zoneOpacity );
}
else
{
DrawRectangle(
string.Format( "Zone{0}", i ),
false,
Displacement+width+1,
yH,
Displacement,
yL,
Color.Transparent,
Plots[i].Pen.Color,
zoneOpacity );
}
}
}
}
Problem is that load of indicator is very slow.
Any idea how to improve load time
|