2
Views
0
Downloads
0
Favorites
candle_body_size
#property indicator_chart_window
extern int font_size = 10;
extern color ColorBull = DodgerBlue;
extern color ColorBeer = Red;
extern string font_name = "Arial";
//+------------------------------------------------------------------+
int start()
{
double k=(WindowPriceMax()-WindowPriceMin())/20;
for(int i=WindowFirstVisibleBar(); i>=0; i--)
{
double rs = (NormalizeDouble(Open[i],Digits)-NormalizeDouble(Close[i],Digits))/Point;
if (rs<0) drawtext(i, High[i]+k, DoubleToStr(rs*(-1),0), ColorBull);
if (rs>0) drawtext(i, Low[i]-Point, DoubleToStr(rs,0), ColorBeer);
}
}
//+------------------------------------------------------------------+
int deinit()
{
ObjectsDeleteAll(0,OBJ_TEXT);
return(0);
}
//+------------------------------------------------------------------+
int drawtext(int n, double Y1, string l,color c)
{
string Name=TimeToStr(Time[n],TIME_DATE|TIME_MINUTES);
ObjectDelete (Name);
ObjectCreate (Name, OBJ_TEXT,0,Time[n],Y1,0,0,0,0);
ObjectSetText(Name, l,font_size,font_name);
ObjectSet (Name, OBJPROP_COLOR, c);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---