Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //+------------------------------------------------------------------+
- //| Waist.mq4 |
- //| Forex |
- //| Forex |
- //+------------------------------------------------------------------+
- #property copyright "Forex"
- #property link "Forex"
- #property version "1.00"
- #property strict
- #property indicator_chart_window
- double Price_Open = 1;
- double Price_Close = 2;
- //+------------------------------------------------------------------+
- //| Custom indicator initialization function |
- //+------------------------------------------------------------------+
- int OnInit()
- {
- //--- indicator buffers mapping
- //---
- return(INIT_SUCCEEDED);
- }
- //+------------------------------------------------------------------+
- //| Custom indicator iteration function |
- //+------------------------------------------------------------------+
- int OnCalculate(const int rates_total,
- const int prev_calculated,
- const datetime &time[],
- const double &open[],
- const double &high[],
- const double &low[],
- const double &close[],
- const long &tick_volume[],
- const long &volume[],
- const int &spread[])
- {
- //---
- Price_Close = iClose(Symbol(),PERIOD_D1,1);
- Price_Open = iOpen(Symbol(),PERIOD_D1,1);
- double Bar_Pips = (Price_Open + Price_Close)/2;
- string Bar_Pips_S = DoubleToString(Bar_Pips, Digits);
- // Print (Bar_Pips_S);
- ObjectCreate ("bar_price_object", Bar_Pips_S, 0,0,0);
- ObjectSet("bar_price_object", OBJPROP_XDISTANCE,1);
- ObjectSet("bar_price_object", OBJPROP_YDISTANCE, 1);
- ObjectSetText ("bar_price_object", Bar_Pips_S, 8 , "Arial", clrRed);
- //--- return value of prev_calculated for next call
- return(rates_total);
- }
- //+------------------------------------------------------------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement