Candle Question

 

Can anyone point me in the right direction, as to, how I would be able to draw an arrow on each candle that meets a certain criteria? Not just an arrow on the first candle, where the criteria is first met.

ObjectCreate("DwnSymbl", OBJ_ARROW, 0, Time[0],vH); // vH = High of the candle

ObjectSet("DwnSymbl", OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);

ObjectSet("DwnSymbl", OBJPROP_COLOR,Lime);

This code will only draw an arrow on the first candle, where the criteria is first met.

Thanks!

 
Yellowbeard:
Can anyone point me in the right direction, as to, how I would be able to draw an arrow on each candle that meets a certain criteria? Not just an arrow on the first candle, where the criteria is first met.

ObjectCreate("DwnSymbl", OBJ_ARROW, 0, Time[0],vH); // vH = High of the candle

ObjectSet("DwnSymbl", OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);

ObjectSet("DwnSymbl", OBJPROP_COLOR,Lime);

This code will only draw an arrow on the first candle, where the criteria is first met.

Thanks!

Replace "DwnSymbl" with "DwnSymbl"+Time[nnn] , replace Time[0] with Time[nnn] and replace vH with High[nnn] (where nnn is the bar number at which the arrow should be drawn)

 

This is placing an up arrow on each candle, not just the candles where the conditions to place the arrow are met. Also, it's placing an up arrow when it should be a down arrow. How do I isolate the specific bar in which the arrow should be placed?

Thanks!

for(int i=1; i<=Bars; i++)

{

if( vO < vC && dB < dS && dB != 0 && dS != 0 )

{

ObjectCreate("DwnASymbl"+Time, OBJ_ARROW, 0, Time,High);

ObjectSet("DwnASymbl", OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);

ObjectSet("DwnASymbl", OBJPROP_COLOR, Lime);

}

if( vO > vC && dB > dS && dS != 0 )

{

ObjectCreate("DwnBSymbl"+Time , OBJ_ARROW, 0, Time,High);

ObjectSet("DwnBSymbl", OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);

ObjectSet("DwnBSymbl", OBJPROP_COLOR, Red);

}

}

vO and vC are 5 min open and close. dB and dS are the number of increases and decreases in the Bid.

Reason: