//+------------------------------------------------------------------+
//| CAN907.mq4 |
//| 2019.4.5--YUWEILIANG |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "2019.4.5--YU5555"
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_chart_window
//--------- input parameters
extern int gmtshift=7;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicators
//---
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---
return (0);
}
//+------------------------------------------------------------------+
//| Custom inddicator iteration function |
//+------------------------------------------------------------------+
int start ()
{
int counted_bars=IndicatorCounted();
//------ TODO: add your code here
double day_high=0;
double day_low=0;
double yesterday_high=0;
double yesterday_oprn=0;
double yesterday_low=0;
double yesterday_close=0;
double today_open=0;
double p=0,s=0,r=0,s1=0,h4=0,s2=0,r2=0,s3=0,l4=0,nq=0,nd=0,d=0;
double H3,h2,h1,l1,l2,l3;
int cnt=720;
double cur_day=0;
double prev_day=0;
double rates_d1[2][6];
//----- exit if period is greater than dayil charts
if (Period()>1440)
{
Pint("error-chart period is greater than 1day.");
return (-1);// then exit
}
//----- get new daily prices & calculate pivots
while (cnt!=0)
{
cur_day=timeday (time [cnt]-(gmtshift*3600));
if (prev_day!=cur_day)
}
yesterday_high=Close [cnt+1];
today_open=Open [cnt];
yesterday_high= day_high;
yesterday_low= day_low;
day_low=High [cnt];
day_high=Low [cnt];
prev_day=cur_day;
}
If (High [cnt]>day_high)
{
day_high=high [cnt];
}
if (low [cny], day_low)
{
day_low=low [cnt];
}
// SetindexValue (cnt,0);
cnt--;
}
//-------- pivot points ------
p=(yesterdaay_high+yesterday_low+yesterday_close)/3;
h4=(yesterday_high-yesterday_low)*0.55+yesterday_close;
h3=(yesterday_high-yesterday_low)*0.275+yesterday_close;
l3=yesterday_close-(yesterday_high-yesterday_low)*0.275;
l4=yesterday_close-(yesterday_high-yesterday_low)*0.55;
//------- drawing lines ------
comment ("camarilla levels by www.forex mastermaker.com");
objectdelete ("l4_line");
objectdelete ("l3_line");
objectdelete ("h3_line");
objectdelete ("h4_line");
objectdelete ("l4_line",obj_hline,0,curtime(),l4);
objectset ("l4_line",objprop_color,red);
objectset ("l4_line",objprop_style,style_solid);
objectdelete ("l3_line",obj_hline,0,curtime(),l3);
objectset ("l3_line",objprop_color,red);
objectset ("l3_line",objprop_style,style_solid);
objectdelete ("h3_line",obj_hline,0,curtime(),h3);
objectset ("h3_line",objprop_color,red);
objectset ("h3_line",objprop_style,style_solid);
objectdelete ("h4_line",obj_hline,0,curtime(),h4);
objectset ("h4_line",objprop_color,red);
objectset ("h4_line",objprop_style,style_solid);
objectsredraw ();
//------- typing lalels
if (objectfind ("l3 label")!=0)
{
objectcreate ("l3 label", obj_text,0, time [0],l3);
objectsettext ("l3 label","l3",8,"arial",red);
}
else
{
objectmove ("l3 label",0,time[0],l3);
}
if (objectfind ("l4 label")!=0)
{
objectcreate ("l4 label", obj_text,0, time [0],l3);
objectsettext ("l4 label","l4",8,"arial",red);
}
else
{
objectmove ("l4 label",0,time[0],l4);
}
if (objectfind ("h4 label")!=0)
{
objectcreate ("h4 label", obj_text,0, time [0],h4);
objectsettext ("h4 label","h4",8,"arial",red);
}
else
{
objectmove ("h4 label",0,time[0],h4);
}
if (objectfind ("h3 label")!=0)
{
objectcreate ("h3 label", obj_text,0, time [0],h3);
objectsettext ("h3 label","h3",8,"arial",red);
}
else
{
objectmove ("h3 label",0,time[0],h3);
}
if (objectfind ("p label")!=0)
{
objectcreate ("label", obj_text,0, time [0],l3);
objectsettext ("label","",8,"arial",deeppink);
}
else
{
objectmove ("p label",0,time[0],p);
}
return (0);
}
;//+------------------------------------------------------------------+

通过MQL5社区和服务探索MetaTrader 5的新机遇
- www.mql5.com
Painting Deals on active chart. It allows analyzing trade history on an account to which you have an investor (read only) password. Type of the arrow displayed indicated the deal type: Right Arrow means In and In/Out deals Arrow Left Left means Out deals.Blue arrows are for Buy deals and Red arrows are for Sell deals. The indicator displays...
- Small Problem to Fix Great Pivot Lines with GMT offset
- 问吧!
- Pivot Points as dots
Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!