//+------------------------------------------------------------------+ //| 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); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Series array that contains close prices for each bar
Series array that contains open prices of each bar
Series array that contains open time of each bar
Indicator Curves created:
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Other Features: