JSEMTS搜尋引擎
 

//+------------------------------------------------------------------+
//| ACD Indicator.mq4 |
//| Copyright 2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2005, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 White //open range
#property indicator_color2 White
#property indicator_color3 Yellow //a values
#property indicator_color4 Yellow
#property indicator_color5 Aqua //c values
#property indicator_color6 Aqua
#property indicator_color7 Purple //pivot
#property indicator_color8 Purple

double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];
double Buffer5[];
double Buffer6[];
double Buffer7[];
double Buffer8[];

double eur_a=0.0010;
double eur_c=0.0014;
double gbp_a=0.0011;
double gbp_c=0.0017;
double chf_a=0.0010;
double chf_c=0.0015;
double jpy_a=0.08;
double jpy_c=0.11;

double a_up=0, a_down=0, c_up=0, c_down=0, p1=0, p2=0,
bars_num=0;

string one_time_flag="",
epc_start="08:30", jpy_start="03:00",
majors4_end="20:30",
a_up_flag="", a_down_flag="",
c_up_flag="", c_down_flag="",
bar_last_time="";


//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_SECTION);
SetIndexBuffer(0,Buffer1);
SetIndexStyle(1,DRAW_SECTION);
SetIndexBuffer(1,Buffer2);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,Buffer3);
SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,Buffer4);
SetIndexStyle(4,DRAW_LINE);
SetIndexBuffer(4,Buffer5);
SetIndexStyle(5,DRAW_LINE);
SetIndexBuffer(5,Buffer6);
SetIndexStyle(6,DRAW_ARROW);
SetIndexBuffer(6,Buffer7);
SetIndexStyle(7,DRAW_ARROW);
SetIndexBuffer(7,Buffer8);

bars_num=15;
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
string candle_date, candle_time="", open_range="",
today, new_bar, new_time;
int open_bar;

today = TimeToStr(Time[0], TIME_DATE);
new_time = TimeToStr(Time[0], TIME_MINUTES);

if (bar_last_time!="" && new_time!=bar_last_time)
new_bar="X";
else new_bar="";

display_alert();

if (one_time_flag=="" || new_bar=="X" ){
one_time_flag="X";
clear_indicators();
bars_num++;

for(int i=0; i<144; i++){ //go back 2+ days on 30 min chart
candle_date = TimeToStr(Time[i], TIME_DATE);
candle_time = TimeToStr(Time[i], TIME_MINUTES);

if (i==0) bar_last_time=candle_time;

if (candle_time=="09:00" && Symbol()!="USDJPY" &&
today==candle_date){
open_bar=i+1;
draw_line(open_bar, Symbol());
}
else if (candle_time=="03:30" && Symbol()=="USDJPY" &&
today==candle_date){
open_bar=i+1;
draw_line(open_bar, Symbol());
}

else if (candle_time==majors4_end){
}
}
} //end one time flag if
//----
return(0);
}
//+------------------------------------------------------------------+
void draw_line(int candle, string smbl){

double a_val, c_val;

if (smbl=="EURUSD"){
a_val = eur_a;
c_val = eur_c;
}
else if (smbl=="GBPUSD"){
a_val = gbp_a;
c_val = gbp_c;
}
else if (smbl=="USDCHF"){
a_val = chf_a;
c_val = chf_c;
}
else if (smbl=="USDJPY"){
a_val = jpy_a;
c_val = jpy_c;
}

a_up=High[candle]+a_val;
c_up=High[candle]+c_val;
a_down=Low[candle]-a_val;
c_down=Low[candle]-c_val;
calc_pivot(smbl);

for(int j=bars_num;j>=0;j--){
Buffer1[j]=High[candle];
Buffer3[j]=High[candle]+a_val;
Buffer5[j]=High[candle]+c_val;
Buffer7[j]=p1;
Buffer8[j]=p2;
}
for(int k=bars_num;k>=0;k--){
Buffer2[k]=Low[candle];
Buffer4[k]=Low[candle]-a_val;
Buffer6[k]=Low[candle]-c_val;
}
}

void clear_indicators(){
SetIndexEmptyValue(0, NULL);
SetIndexEmptyValue(1, NULL);
SetIndexEmptyValue(2, NULL);
SetIndexEmptyValue(3, NULL);
SetIndexEmptyValue(4, NULL);
SetIndexEmptyValue(5, NULL);
SetIndexEmptyValue(6, NULL);
SetIndexEmptyValue(7, NULL);
ArrayInitialize(Buffer1,NULL);
ArrayInitialize(Buffer2,NULL);
ArrayInitialize(Buffer3,NULL);
ArrayInitialize(Buffer4,NULL);
ArrayInitialize(Buffer5,NULL);
ArrayInitialize(Buffer6,NULL);
ArrayInitialize(Buffer7,NULL);
ArrayInitialize(Buffer8,NULL);
}

void display_alert(){

if (Ask>a_up && a_up_flag=="" && a_up!=0){
a_up_flag="X";
Alert(Symbol()," ","A Up"," ", Ask);
}
else if (Bid a_down_flag="X";
Alert(Symbol()," ","A Down"," ", Bid);
}
else if (Ask>c_up && a_down_flag=="X" && c_up!=0 && c_up_flag==""){
c_up_flag="X";
Alert(Symbol()," ","C Up"," ", Ask);
}
else if (Bid c_down_flag="X";
Alert(Symbol()," ","C Down"," ", Bid);
}
}

void calc_pivot(string smbl){

string bar_date, bar_time, yestarday;
double o=0,h=0,l=0,c=0;

yestarday=TimeToStr(CurTime()-86400, TIME_DATE);

for(int i=144; i>0; i--){
bar_date = TimeToStr(Time[i], TIME_DATE);
bar_time = TimeToStr(Time[i], TIME_MINUTES);

if (bar_time==epc_start && smbl!="USDJPY"){
o = Open[i];
l = Low[i];
h = High[i];
}
else if (bar_time==jpy_start && smbl=="USDJPY"){
o = Open[i];
l = Low[i];
h = High[i];
}
else if (bar_time==majors4_end){
c = Close[i];
if (bar_date==yestarday) break;
}

if (h==0)
h=High[i];
else if (h h=High[i];

if (l==0)
l=Low[i];
else if (l>Low[i])
l=Low[i];
}

double day_piv_price, day_piv_diff, pt1, pt2;

day_piv_price=(h+l+c)/3;
day_piv_diff =(h+l)/2-day_piv_price;
p1=day_piv_price+day_piv_diff;
p2=day_piv_price-day_piv_diff;
}






搜尋引擎讓我們程式搜尋結果更加完美
  • 如果您覺得該文件有幫助到您,煩請按下我
  • 如果您覺得該文件是一個一無是處的文件,也煩請按下我

  • 搜尋引擎該文件您看起來是亂碼嗎?您可以切換編碼方式試試看!ISO-8859-1 | latin1 | euc-kr | euc-jp | CP936 | CP950 | UTF-8 | GB2312 | BIG5 |
    搜尋引擎本文件可能涉及色情、暴力,按我申請移除該文件

    搜尋引擎網址長?按我產生分享用短址

    ©2024 JSEMTS

    https://tw.search.yahoo.com/search;_ylt=A8tUwYgkQU1YcXoAUE9r1gt.;_ylc=X1MDMjExNDcwNTAwMwRfcgMyBGZyA3lmcC10LTkwMC10dwRncHJpZAMxWU5tY2FYMVFGQ2ZvUXZGN1N0bzVBBG5fcnNsdAMwBG5fc3VnZwMwBG9yaWdpbgN0dy5zZWFyY2gueWFob28uY29tBHBvcwMwBHBxc3RyAwRwcXN0cmwDBHFzdHJsAzQ4BHF1ZXJ5AyVFNiVBRCVBMSVFNiVBRCU4QyUyMCVFNSVCMCU4OCVFNiU4MyU4NSVFNSU5QyU5OAR0X3N0bXADMTQ4MTQ1Nzk3Ng--?p=%E6%AD%A1%E6%AD%8C+%E5%B0%88%E6%83%85%E5%9C%98&fr2=sb-top-tw.search&fr=yfp-t-900-tw&rrjfid=6924099 https://tw.search.yahoo.com/search;_ylt=A8tUwYgkQU1YcXoAUE9r1gt.;_ylc=X1MDMjExNDcwNTAwMwRfcgMyBGZyA3lmcC10LTkwMC10dwRncHJpZAMxWU5tY2FYMVFGQ2ZvUXZGN1N0bzVBBG5fcnNsdAMwBG5fc3VnZwMwBG9yaWdpbgN0dy5zZWFyY2gueWFob28uY29tBHBvcwMwBHBxc3RyAwRwcXN0cmwDBHFzdHJsAzQ4BHF1ZXJ5AyVFNiVBRCVBMSVFNiVBRCU4QyUyMCVFNSVCMCU4OCVFNiU4MyU4NSVFNSU5QyU5OAR0X3N0bXADMTQ4MTQ1Nzk3Ng--?p=%E6%AD%A1%E6%AD%8C+%E5%B0%88%E6%83%85%E5%9C%98&fr2=sb-top-tw.search&fr=yfp-t-900-tw&rrjfid=5862901 https://tw.search.yahoo.com/search;_ylt=A8tUwZJ2QE1YaVcAUmFr1gt.;_ylc=X1MDMjExNDcwNTAwMwRfcgMyBGZyA3lmcC10LTkwMC1zLXR3BGdwcmlkAwRuX3JzbHQDMARuX3N1Z2cDMARvcmlnaW4DdHcuc2VhcmNoLnlhaG9vLmNvbQRwb3MDMARwcXN0cgMEcHFzdHJsAwRxc3RybAM4NARxdWVyeQMlRTglQjYlODUlRTUlOEYlQUYlRTYlODQlOUIlRTclOUElODQlRTUlQUYlQjYlRTUlQUYlQjYlMjAlRTglODMlQTElRTUlQUUlODklRTUlQTglOUMEdF9zdG1wAzE0ODE0NTc3OTM-?p=%E8%B6%85%E5%8F%AF%E6%84%9B%E7%9A%84%E5%AF%B6%E5%AF%B6+%E8%83%A1%E5%AE%89%E5%A8%9C&fr2=sb-top-tw.search&fr=yfp-t-900-s-tw&rrjfid=2510036 https://tw.search.yahoo.com/search;_ylt=A8tUwZJ2QE1YaVcAUmFr1gt.;_ylc=X1MDMjExNDcwNTAwMwRfcgMyBGZyA3lmcC10LTkwMC1zLXR3BGdwcmlkAwRuX3JzbHQDMARuX3N1Z2cDMARvcmlnaW4DdHcuc2VhcmNoLnlhaG9vLmNvbQRwb3MDMARwcXN0cgMEcHFzdHJsAwRxc3RybAM4NARxdWVyeQMlRTglQjYlODUlRTUlOEYlQUYlRTYlODQlOUIlRTclOUElODQlRTUlQUYlQjYlRTUlQUYlQjYlMjAlRTglODMlQTElRTUlQUUlODklRTUlQTglOUMEdF9zdG1wAzE0ODE0NTc3OTM-?p=%E8%B6%85%E5%8F%AF%E6%84%9B%E7%9A%84%E5%AF%B6%E5%AF%B6+%E8%83%A1%E5%AE%89%E5%A8%9C&fr2=sb-top-tw.search&fr=yfp-t-900-s-tw&rrjfid=3532172 https://tw.search.yahoo.com/search;_ylt=A8tUwYgkQU1YcXoAUE9r1gt.;_ylc=X1MDMjExNDcwNTAwMwRfcgMyBG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