RSI\Stochastic\trend配合使用EA
发布日期:2021-10-16 07:11:56 浏览次数:1 分类:技术文章
//+------------------------------------------------------------------+
//|                                                       SJPTEST.mq4 |
//|                         Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link       "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---引用RSI值,
      double a=iRSI(NULL,0,14,PRICE_CLOSE,4);
      if(a>80)       Print("wwww",a);
      double b=iRSI(NULL,0,14,PRICE_CLOSE,0);
      if(b>40)     Print("qqq",b);
//---引用KD指标 ,返回当前柱对应随机振荡指标的K值
      double c=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0);
      Print("cccc",c);
//---可以用此指标判断买入、卖出时机。
//---
    return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

    double a=iRSI(NULL,0,14,PRICE_CLOSE,1);
    Print("",a);
  }
//+------------------------------------------------------------------+

上一篇:(datetime)问题possible loss…
下一篇:OrderTicket( ) ,OrderM…