客服热线:18391752892

一款自动显示买卖点的指标

   日期:2019-01-12     浏览:426    
马上注册,结交更多好友,下载更多资源

您需要 登录 才可以下载或查看,没有帐号?注册 //+------------------------------------------------------------------+
//|                         4Stochs EA for metaTrader 4 |
//|                                     version 0.1 |
//|                       Copyright 2008 Forex-Factory |
//|              Strategy first published by David (ljyljl5555) |
//|                          EA Conversion by Azmel Ainul |
//+------------------------------------------------------------------+
extern int    Magic     = 775769;
extern double LotSize     = 0.01;
extern int    TP       = 10;
extern int    SL       = 10;
extern string LongComment = 4Stochs Long
extern string ShortComment = 4Stochs Short
double S1M;
double S1S;
double S2M;
double S2S;
double S3M;
double S3S;
double S4M;
double S4S;
string Signal;
string Status;
double ticket;
double slippage=5;
int init()
{
   S1M=iStochastic(NULL,PERIOD_M5,5,3,3,MODE_SMA,0,MODE_MAIN,0);
   S1S=iStochastic(NULL,PERIOD_M5,5,3,3,MODE_SMA,0,MODE_SIGNAL,0);
   S2M=iStochastic(NULL,PERIOD_M30,5,3,3,MODE_SMA,0,MODE_MAIN,0);
   S2S=iStochastic(NULL,PERIOD_M30,5,3,3,MODE_SMA,0,MODE_SIGNAL,0);
   S3M=iStochastic(NULL,PERIOD_H1,5,3,3,MODE_SMA,0,MODE_MAIN,0);
   S3S=iStochastic(NULL,PERIOD_H1,5,3,3,MODE_SMA,0,MODE_SIGNAL,0);
   S4M=iStochastic(NULL,PERIOD_H1,14,3,3,MODE_SMA,0,MODE_MAIN,0);
   S4S=iStochastic(NULL,PERIOD_H1,14,3,3,MODE_SMA,0,MODE_SIGNAL,0);
   Signal= NONE
   Status= READY
   if(S1M S1S S2M S2S S3M S3S S4M S4S)
   {
     Signal= LONG
     Status= SHORT ACTIVE
   }
   if(S1M S1S S2M S2S S3M S3S S4M S4S)
   {
     Signal= SHORT
     Status= LONG ACTIVE
   }
   return(0);
}
int start()
{
   S1M=iStochastic(NULL,PERIOD_M5,5,3,3,MODE_SMA,0,MODE_MAIN,0);
   S1S=iStochastic(NULL,PERIOD_M5,5,3,3,MODE_SMA,0,MODE_SIGNAL,0);
   S2M=iStochastic(NULL,PERIOD_M30,5,3,3,MODE_SMA,0,MODE_MAIN,0);
   S2S=iStochastic(NULL,PERIOD_M30,5,3,3,MODE_SMA,0,MODE_SIGNAL,0);
   S3M=iStochastic(NULL,PERIOD_H1,5,3,3,MODE_SMA,0,MODE_MAIN,0);
   S3S=iStochastic(NULL,PERIOD_H1,5,3,3,MODE_SMA,0,MODE_SIGNAL,0);
   S4M=iStochastic(NULL,PERIOD_H1,14,3,3,MODE_SMA,0,MODE_MAIN,0);
   S4S=iStochastic(NULL,PERIOD_H1,14,3,3,MODE_SMA,0,MODE_SIGNAL,0);
   Signal= NONE
   if(S1M S1S S2M S2S S3M S3S S4M S4S)
   {
     Signal= LONG
   }
   if(S1M S1S S2M S2S S3M S3S S4M S4S)
   {
     Signal= SHORT
   }
   if(Status== READY Signal== LONG )
   {
     ticket=OrderSend(Symbol(),OP_BUY,LotSize,Ask,slippage,Ask-SL*Point,Ask+TP*Point,LongComment,Magic,0,Blue);
     if(ticket -1)
     {
       Status= LONG ACTIVE
     }
   }
   if(Status== READY Signal== SHORT )
   {
     ticket=OrderSend(Symbol(),OP_SELL,LotSize,Bid,slippage,Bid+SL*Point,Bid-TP*Point,ShortComment,Magic,0,Red);
     if(ticket -1)
     {
       Status= SHORT ACTIVE
     }
   }
   if(Status== LONG ACTIVE (Signal== NONE || Signal== SHORT ))
   {
     Status= READY
   }
   if(Status== SHORT ACTIVE (Signal== NONE || Signal== LONG ))
   {
     Status= READY
   }
   return(0);
}

外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!


特别提示:本信息由相关企业自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。


0相关评论
相关行情
推荐行情
点击排行