I can place Objects above candle's wick using ObjectSet with the Price co-ordinate stored in vsa[b] (i.e. based on High[b] or Low[b] as appropriate.
BUT if I add a small gap based on points or a fixed factor, the characters will appear at different distances away from the candles wick depending on the timeframe - because the charts price scale varies.
How can I avoid this?
Get I get the charts current scale?
e.g.
int DisplaySignal(int b)
{
if (signal[b] != EMPTY_VALUE)
{
if (ObjectCreate(text[signal[b]]+" "+sctr, OBJ_ARROW, 0, Time[b], vsa[b]) == true)
{
ObjectSet(text[signal[b]]+" "+sctr, OBJPROP_ARROWCODE, code[signal[b]]);
if (signal[b] > 2)
{
ObjectSet(text[signal[b]]+" "+sctr, OBJPROP_COLOR, Crimson);
ObjectSet(text[signal[b]]+" "+sctr, OBJPROP_XDISTANCE, 20);
SetIndexArrow(3,code[signal[b]]);
//
}
else
{
ObjectSet(text[signal[b]]+" "+sctr, OBJPROP_COLOR, CornflowerBlue);
ObjectSet(text[signal[b]]+" "+sctr, OBJPROP_XDISTANCE, 20);
SetIndexArrow(3,code[signal[b]]);
}
sctr++; Print("Signal[",b,"]=",signal[b]);
}
}
return(0);
}
but the height
BUT if I add a small gap based on points or a fixed factor, the characters will appear at different distances away from the candles wick depending on the timeframe - because the charts price scale varies.
How can I avoid this?
Get I get the charts current scale?
e.g.
int DisplaySignal(int b)
{
if (signal[b] != EMPTY_VALUE)
{
if (ObjectCreate(text[signal[b]]+" "+sctr, OBJ_ARROW, 0, Time[b], vsa[b]) == true)
{
ObjectSet(text[signal[b]]+" "+sctr, OBJPROP_ARROWCODE, code[signal[b]]);
if (signal[b] > 2)
{
ObjectSet(text[signal[b]]+" "+sctr, OBJPROP_COLOR, Crimson);
ObjectSet(text[signal[b]]+" "+sctr, OBJPROP_XDISTANCE, 20);
SetIndexArrow(3,code[signal[b]]);
//
}
else
{
ObjectSet(text[signal[b]]+" "+sctr, OBJPROP_COLOR, CornflowerBlue);
ObjectSet(text[signal[b]]+" "+sctr, OBJPROP_XDISTANCE, 20);
SetIndexArrow(3,code[signal[b]]);
}
sctr++; Print("Signal[",b,"]=",signal[b]);
}
}
return(0);
}
but the height