0
Views
0
Downloads
0
Favorites
Circles_for_fun
//+------------------------------------------------------------------+
//| Circles_for_fun.mq4 |
//| Zen_Leow |
//| |
//+------------------------------------------------------------------+
#property copyright "Zen_Leow"
#property link ""
#property indicator_chart_window
extern int NumberOfBars = 0; // means do all
extern double Scale_Factor = 0.05;
extern color UpCircle = Blue;
extern color DownCircle = Red;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
ObjectsDeleteAll();
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
if (NumberOfBars <= 0)
{
for(int i=0; i<limit;i++)
{
ObjectCreate("ellipse"+Time[i],OBJ_ELLIPSE,0,Time[i],Open[i],Time[i],Close[i]);
ObjectSet("ellipse"+Time[i],OBJPROP_SCALE,Scale_Factor);
if (Close[i] > Open[i])
{
ObjectSet("ellipse"+Time[i],OBJPROP_COLOR,UpCircle);
}
else
{
ObjectSet("ellipse"+Time[i],OBJPROP_COLOR,DownCircle);
}
}
}
else
{
ObjectsDeleteAll();
for(i=0; i<NumberOfBars;i++)
{
ObjectCreate("ellipse"+Time[i],OBJ_ELLIPSE,0,Time[i],Open[i],Time[i],Close[i]);
ObjectSet("ellipse"+Time[i],OBJPROP_SCALE,Scale_Factor);
if (Close[i] > Open[i])
{
ObjectSet("ellipse"+Time[i],OBJPROP_COLOR,UpCircle);
}
else
{
ObjectSet("ellipse"+Time[i],OBJPROP_COLOR,DownCircle);
}
}
}
//---- done
return(0);
}
//+------------------------------------------------------------------+
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
---