Use a trendline and set the style to dash
Thank you. It works like a charm!
void CreatePositionLine(datetime time1, double price1, datetime time2, double price2, int lineColor) { string name = "Position line " + TimeToString(time1); if (!ObjectCreate(0, name, OBJ_TREND, 0, time1, price1, time2, price2)) return; ObjectSetInteger(0, name, OBJPROP_COLOR, lineColor); ObjectSetInteger(0, name, OBJPROP_STYLE, STYLE_DOT); ObjectSetInteger(0, name, OBJPROP_WIDTH, 1); ObjectSetInteger(0, name, OBJPROP_BACK, false); ObjectSetInteger(0, name, OBJPROP_SELECTABLE,false); ObjectSetInteger(0, name, OBJPROP_SELECTED, false); ObjectSetInteger(0, name, OBJPROP_RAY_RIGHT, false); ObjectSetInteger(0, name, OBJPROP_HIDDEN, true); ObjectSetInteger(0, name, OBJPROP_ZORDER, 0); }

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
Hello,
How can we draw a dashed, colored line from a (Price 1, Time 1) point to another (Price 2, Time 2) point?
Something like the blue dashed lines on this screenshot: