Print your variables before each if, and add a print statement inside each if, and find out why.
I figured it out. Had to change a few things and give each object it's own name. That way there are no conflicts.
if( vO > vC && dB < dS && dB != 0 ) { ObjectCreate(StringConcatenate("UpASymblA",TimeCurrent()), OBJ_ARROW, 0, Time[0],vH); ObjectSet(StringConcatenate("UpASymblA",TimeCurrent()), OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN); ObjectSet(StringConcatenate("UpASymblA",TimeCurrent()), OBJPROP_COLOR, Yellow); } if( vO > vC && dB > dS && dS != 0 ) { ObjectCreate(StringConcatenate("UpBSymblB",TimeCurrent()), OBJ_ARROW, 0, Time[0],vH); ObjectSet(StringConcatenate("UpBSymblB",TimeCurrent()), OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN); ObjectSet(StringConcatenate("UpBSymblB",TimeCurrent()), OBJPROP_COLOR, Lime); } if( vO > vC && dB == 0 ) { ObjectCreate(StringConcatenate("UpCSymblC",TimeCurrent()), OBJ_ARROW, 0, Time[0],vH); ObjectSet(StringConcatenate("UpCSymblC",TimeCurrent()), OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN); ObjectSet(StringConcatenate("UpCSymblC",TimeCurrent()), OBJPROP_COLOR, Blue); } if( vO > vC && dB == dS ) { ObjectCreate(StringConcatenate("UpDSymblD",TimeCurrent()), OBJ_ARROW, 0, Time[0],vH); ObjectSet(StringConcatenate("UpDSymblD",TimeCurrent()), OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN); ObjectSet(StringConcatenate("UpDSymblD",TimeCurrent()), OBJPROP_COLOR, White); }
Would like to know how to change arrow to a dot, though.
Thanks!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I'm trying to identify candles where, a buy candle has more selling than buying, and a sell candle has more buying than selling. I have the values , but drawing the arrows to mark the candle is a bit of a problem. The following code is suppose to draw a green down arrow, on the high ,of a sell candle, when there's more increases in the close price, than decreases; a white down candle when there's more decreases in the close price, than increases; and a yellow when there is only decreases.
For a buy candle, a red down arrow, when there's more decreases in the close price, than increases; a white down candle when there's more increases than decreases; and a yellow when there is only increases.
The code instead, is drawing a red up candle for each condition. I realize that there can be more than one arrow drawn on a candle due to changes in conditions. That's o.k. for now, I can deal with that later. Just trying to get the right candle to be drawn first. Not sure what I'm doing wrong.
Thanks!