客服热线:18391752892
顺水的鱼MT4外汇EA趋势对冲马丁延迟套利指标智能交易系统
顺水的鱼MT4外汇EA
商家二维码
手机查看商家
18391752892
首页>金融学院>行业分析>MT5神经网络EA <上一个 下一个>
交易员学习资料推荐

  • 注册资本|未填写
  • 企业类型|
  • 主营产品|
  • 公司地区|全国
  • 公司荣誉|
金融学院分类
  • 暂无分类
本页信息为顺水的鱼MT4外汇EA为您提供的“MT5神经网络EA”金融学院,如您想了解更多关于“MT5神经网络EA”关注顺水外汇网。
品牌MT5神经网络EA 有效期至长期有效 最后更新2019-01-10 18:44
浏览次数345

MT5神经网络EA

//+------------------------------------------------------------------+ //|                                             macdNeuroExample.mq5 | //|                                                        wangyu204 | //|                                           http://www.fxunion.com | //+------------------------------------------------------------------+ #property copyright wangyu204 #property link       http://www.fxunion.com #property version   1.00 //本EA通过模拟过去训练最佳权重w数据,操作未来 #include #include //神经网络权重  每个因子一个权值 input double w0=0.5; input double w1=0.5; input double w2=0.5; input double w3=0.5; input double w4=0.5; input double w5=0.5; input double w6=0.5; input double w7=0.5; input double w8=0.5; input double w9=0.5; input double w10=0.5; input double w11=0.5; input double w12=0.5; input double w13=0.5; input double w14=0.5; input double w15=0.5; input double w16=0.5; input double w17=0.5; input double w18=0.5; input double w19=0.5; //全局变量 int iMACD_handle;//macd indicator handle double iMACD_mainbuf[];//dynamic array for storing indicator values double iMACD_signalbuf[];//dynamic array for storing indicator values double inputs[20];//输入因子 double weight[20];//对应输入权重 string my_symbol; ENUM_TIMEframeS my_timeframe; double lot_size; double out; CTrade m_Trade; //交易相关 CPositionInfo m_Position;//持仓相关 //+------------------------------------------------------------------+ //| Expert initialization function                                   | //+------------------------------------------------------------------+ int onInit()   { //---    my_symbol=Symbol();    my_timeframe=PERIOD_CURRENT;    lot_size=SymbolInfoDouble(my_symbol,SYMBOL_VOLUME_MIN);    iMACD_handle=iMACD(my_symbol,my_timeframe,12,26,9,PRICE_CLOSE);    if(iMACD_handle==INVALID_HANDLE)      {       Print( Failed to get the indicator handle       return(-1);      }      ChartIndicatorAdd(ChartID(),0,iMACD_handle);    ArraySetAsSeries(iMACD_mainbuf,true);//设置数组序列    ArraySetAsSeries(iMACD_signalbuf,true);      //place weights into the array    weight[0]=w0;    weight[1]=w1;    weight[2]=w2;    weight[3]=w3;    weight[4]=w4;    weight[5]=w5;    weight[6]=w6;    weight[7]=w7;    weight[8]=w8;    weight[9]=w9;    weight[10]=w10;    weight[11]=w11;    weight[12]=w12;    weight[13]=w13;    weight[14]=w14;    weight[15]=w15;    weight[16]=w16;    weight[17]=w17;    weight[18]=w18;    weight[19]=w19;      return(0);   } //+------------------------------------------------------------------+ //| Expert deinitialization function                                 | //+------------------------------------------------------------------+ void onDeinit(const int reason)   { //---    IndicatorRelease(iMACD_handle);//delete the indicator handle and deallocate the memory space    ArrayFree(iMACD_mainbuf);//free dynamic array    ArrayFree(iMACD_signalbuf);   } //+------------------------------------------------------------------+ //| Expert tick function                                             | //+------------------------------------------------------------------+ void onTick()   { //---    int err1=0,err2=0;    err1=CopyBuffer(iMACD_handle,0,2,ArraySize(inputs)/2,iMACD_mainbuf);    err2=CopyBuffer(iMACD_handle,0,2,ArraySize(inputs)/2,iMACD_signalbuf);    if(err1 0 || err2 0)      {       Print( Failed to copy data from the indicator buffer       return;      }    //input标准化    double d1=-1.0;    double d2=1.0;    double x_min=MathMin(iMACD_mainbuf[ArrayMinimum(iMACD_mainbuf)],iMACD_signalbuf[ArrayMinimum(iMACD_signalbuf)]);    double x_max=MathMax(iMACD_mainbuf[ArrayMaximum(iMACD_mainbuf)],iMACD_signalbuf[ArrayMaximum(iMACD_signalbuf)]);    for(int i=0;i      {       inputs[i*2]=(iMACD_mainbuf[i]-x_min)*(d2-d1)/(x_max-x_min)+d1;       inputs[i*2+1]=(iMACD_signalbuf[i]-x_min)*(d2-d1)/(x_max-x_min)+d1;      }    //out    out=calculateNeuron(inputs,weight);      if(out 0)      {       if(m_Position.Select(my_symbol))         {          if(m_Position.PositionType()==POSITION_TYPE_SELL){m_Trade.PositionClose(my_symbol);}          if(m_Position.PositionType()==POSITION_TYPE_BUY){return;}         }       m_Trade.Buy(lot_size,my_symbol);      }    if(out =0)      {       if(m_Position.Select(my_symbol))         {          if(m_Position.PositionType()==POSITION_TYPE_BUY){m_Trade.PositionClose(my_symbol);}          if(m_Position.PositionType()==POSITION_TYPE_SELL){return;}         }       m_Trade.Sell(lot_size,my_symbol);      }   } //+------------------------------------------------------------------+ double calculateNeuron(double x[],double w[])    double NET=0.0;    for(int i=0;i      {       NET+=x[i]*w[i];      }    NET*=0.1;//additional coefficient d=0.1    return(activateNeuron(NET)); //激励函数 double activateNeuron(double x)    double out;    out=(exp(x)-exp(-x))/(exp(x)+exp(-x));    return(out); 本文标签:MT5
联系方式
顺水的鱼MT4外汇EA趋势对冲马丁延迟套利指标智能交易系统
0相关评论

为您推荐

免责声明:
当前页为MT5神经网络EA价格信息展示,该页所展示的MT5神经网络EA批发价格、MT5神经网络EA报价等相关信息均有企业自行提供,MT5神经网络EA价格真实性、准确性、合法性由店铺所有企业完全负责的。顺水的鱼MT4外汇EA趋势对冲马丁延迟套利指标智能交易系统对此不承担任何保证责任。
友情提醒:
建议您通过拨打MT5神经网络EA厂家联系方式确认最终价格,并索要MT5神经网络EA样品确认产品质量。如MT5神经网络EA报价过低,可能为虚假信息,请确认MT5神经网络EA报价真实性,谨防上当受骗。