My goal is to print triangles above and below every bar (the problem here is simplified just to illustrate). All i get are triangles on the last finished bar... all others older bars seem unmodified.
My print check routines in the output window show the opposite. Thereafter all the bars should be modified (refer to attachment).
This is the simplified code:
-------------------------------------
if (downtrend && returnbardown)
{
Print (Instrument.FullName.ToString()+ "MARKED DOWN--> Bar No. " + CurrentBar.ToString () + ">> O:" + Open.ToString() + ">> C:" + Close.ToString() + ">>H:" + High.ToString() + ">> L:" + Low.ToString());
DrawTriangleUp("tryup",true, 0,Low[0] - TickSize * 12, downcolor);
barup.Set(1); }
else
barup.Set(0);
if (uptrend && returnbarup)
{
Print (Instrument.FullName.ToString()+ "MARKED UP--> Bar No. " + CurrentBar.ToString () + ">> O:" + Open.ToString() + ">> C:" + Close.ToString() + ">>H:" + High.ToString() + ">> L:" + Low.ToString());
DrawTriangleDown("trydown",true,0,High[0] + TickSize * 12, upcolor);
bardown.Set(1);}
else
bardown.Set(0);
------------------------------------------------------------------
In the same indicator i modifiy the outline of candles. This works for the current and all older candles. I use the same programming for this and i cannot find out why this works in this case and in the above mentioned "triangle" case not??????
This is the code for the candle modification working properly:
--------------------------------------------------------------
if (switch1 == false)
{
highinside = High[1];
lowinside = Low[1];
}
if (Open[0] > Close[0])
{
BarColor = downcolor;
CandleOutlineColor = outlinecolordown;
}
else
{
BarColor = upcolor;
CandleOutlineColor = outlinecolorup;
}
insidebar.Set(1);
switch1 = true;
-------------------------------------------------------
You can see the result here (see attachment):
Please give me a hint, why the DrawTriangle Up and Down Function is not working properly???
thanks christian
Comment