编码帮助 - 页 784

 

真的很喜欢这个指标,但稍微有点重绘,需要帮助解决,请

通过手动交易,我能够使用这个指标产生这个结果(https://www.forexfactory.com/siglot/199244),虽然压力很大,但我愿意分享,一旦我能够将这个指标自动纳入系统而不重绘。


//+------------------------------------------------------------------+
//|                                                  Entry Point.mq4 |
//|                                                                  |
//|                                                                  |
//| Volatility quality index originaly developed by                  |
//| Thomas Stridsman (August 2002 Active Trader Magazine)            |
//|                                                                  |
//| Price pre-smoothing and filter added by raff1410                 |
//+------------------------------------------------------------------+
#property copyright "mladen"
#property link      "mladenfx@gmail.com"

#property indicator_separate_window
#property indicator_minimum 0.0
#property indicator_maximum 100.0
#property indicator_buffers 5
#property indicator_color1 CLR_NONE
#property indicator_color2 CLR_NONE
#property indicator_color3 Lime
#property indicator_color4 Red
#property indicator_color5 CLR_NONE

extern int KPeriod = 21;
extern int DPeriod = 12;
extern int Slowing = 3;
extern int method = 0;
extern int price = 0;
extern string WPR = "";
extern int ExtWPRPeriod = 14;
extern double ZoneHighPer = 70.0;
extern double ZoneLowPer = 30.0;
extern bool Modeone = TRUE;
extern bool PlaySoundBuy = FALSE;
extern bool PlaySoundSell = FALSE;
int Grima = 0;
extern string FileSoundBuy = "analyze buy";
extern string FileSoundSell = "analyze sell";
double stasi[];
double Regio[];
double Ray[];
double Dalio[];
double Mekno[];
int Tekno = 0;
int Dupon = 0;
int Travel = 0;
int DTra = 0;
int AsTra = 0;
int xTra = 0;

int init() {

   IndicatorBuffers(5);
   SetIndexStyle(0, DRAW_LINE, EMPTY, 0);
   SetIndexBuffer(0, stasi);
   SetIndexStyle(1, DRAW_LINE, EMPTY, 0);
   SetIndexBuffer(1, Regio);
   SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 5);
   SetIndexArrow(2, 244);
   SetIndexBuffer(2, Ray);
   SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 5);
   SetIndexBuffer(3, Dalio);
   SetIndexArrow(3, 244);
   SetIndexStyle(4, DRAW_LINE, EMPTY, 0);
   SetIndexBuffer(4, Mekno);
   Tekno = KPeriod + Slowing;
   Dupon = Tekno + DPeriod;
   SetIndexDrawBegin(0, Tekno);
   SetIndexDrawBegin(1, Dupon);
   SetIndexDrawBegin(4, ExtWPRPeriod);
   SetIndexEmptyValue(2, 0);
   SetIndexEmptyValue(3, 0);
   return (0);
}

int start() {
   double priceField;
   double highCal;
   double lowCal;
   double moov;
   double morz;
   double ore;
   double larzo;
   int shaft;
   int indiCount = IndicatorCounted();
   if (Bars <= Dupon) return (0);
   if (indiCount < 1) {
      for (int iterat0 = 1; iterat0 <= Tekno; iterat0++) stasi[Bars - iterat0] = 0;
      for (iterat0 = 1; iterat0 <= Dupon; iterat0++) Regio[Bars - iterat0] = 0;
   }
   if (indiCount > 0) indiCount--;
   int iterat1 = Bars - indiCount;
   for (iterat0 = 0; iterat0 < iterat1; iterat0++) {
      stasi[iterat0] = iStochastic(NULL, 0, KPeriod, DPeriod, Slowing, method, priceField, MODE_MAIN, iterat0);
      Regio[iterat0] = iStochastic(NULL, 0, 21, DPeriod, Slowing, method, priceField, MODE_SIGNAL, iterat0);
   }
   iterat0 = Bars - ExtWPRPeriod - 1;
   if (indiCount > ExtWPRPeriod) iterat0 = Bars - indiCount - 1;
   while (iterat0 >= 0) {
      highCal = High[iHighest(NULL, 0, MODE_HIGH, ExtWPRPeriod, iterat0)];
      lowCal = Low[iLowest(NULL, 0, MODE_LOW, ExtWPRPeriod, iterat0)];
      if (!Bhat(highCal - lowCal, 0.0)) Mekno[iterat0] = (highCal - Close[iterat0]) / (-0.01) / (highCal - lowCal) + 100.0;
      iterat0--;
   }
   if (indiCount > 0) indiCount--;
   iterat1 = Bars - indiCount;
   for (iterat0 = iterat1 - 1; iterat0 >= 0; iterat0--) {
      moov = Regio[iterat0];
      morz = Regio[iterat0 + 1];
      ore = stasi[iterat0];
      larzo = stasi[iterat0 + 1];
      if (ore > moov && larzo < morz && larzo < ZoneLowPer && morz < ZoneLowPer) {
         Ray[iterat0] = 100;
         shaft = iBarShift(NULL, 0, DTra);
         if (Modeone && shaft != iterat0 && xTra == 1) Ray[shaft] = 0;
         DTra = Time[iterat0];
         xTra = 1;
      } else Ray[iterat0] = 0;
      if (ore < moov && larzo > morz && larzo > ZoneHighPer && morz > ZoneHighPer) {
         Dalio[iterat0] = 100;
         shaft = iBarShift(NULL, 0, AsTra);
         if (Modeone && shaft != iterat0 && xTra == -1) Dalio[shaft] = 0;
         AsTra = Time[iterat0];
         xTra = -1;
      } else Dalio[iterat0] = 0;
   }
   if (PlaySoundBuy && Ray[Grima] > 0.0) {
      if (Travel != Time[Grima]) PlaySound(FileSoundBuy);
      Travel = Time[Grima];
   }
   if (PlaySoundSell && Dalio[Grima] > 0.0) {
      if (Travel != Time[Grima]) PlaySound(FileSoundSell);
      Travel = Time[Grima];
   }
   return (0);
}

bool Bhat(double Atat0, double Atat1) {
   bool Modenine = NormalizeDouble(Atat0 - Atat1, 8) == 0.0;
   return (Modenine);
}
 
Mayowa Daniel Sonaike:


请勿重复发帖!

我已经删除了你的重复帖子。

 

你好。谁能帮助我在图表上出现箭头时下达买入和卖出指令?我使用的是WADDAH atr爆炸指标中的箭头,任何帮助都是巨大的。谢谢

<ex4文件已删除>。

 
你好,你能帮助我吗?我如何在我的图表模板上添加设计,并像所附图片那样显示,我如何添加阈值,如当达到一定的金额或账户余额 达到X金额时停止交易,附件是我的代码,请随时添加更多和修改。
附加的文件:
Capture.JPG  128 kb
 
Eustorgio Trentino:
你好,你能帮助我吗?我怎样才能在我的图表模板上添加设计,并像附件中的图片那样显示出来,我怎样才能添加阈值,比如当达到一定的金额或账户余额 达到X金额时停止交易。

不要重复发帖!!

我已经删除了你的重复文章。

 
因为我使用的是MT4,当我回测 前一年的时候,它就不工作了
 
Eustorgio Trentino:
各位需要帮助,是否可以回测 前一年,比如从2020年1月到2020年12月? 因为我使用的是MT4,当我回测 前一年的时候,它不会工作。

只要你有足够的历史数据的符号,当然可以。

 
嗨,大家好......我希望你在这些困难时期有良好的健康

有可能添加JMA Jurik移动平均线 的选项吗?

我感谢一个好的程序员与一个良好的心脏可以帮助我,不要求报酬的回报...我提前感谢你,...问候大家...谢谢你

...问候
附加的文件:
 
谢谢大家提供的这些例子。
 
好的
原因: