Coding help - page 784

 

Really love this indicator but is slightly repaints, need help fixing it please

Was able to use this indicator to generate this result (https://www.forexfactory.com/siglot/199244) by manually trading it (quite stressful though) with my system which i am willing to share once i am able to automate this indicator into the system without it repainting


//+------------------------------------------------------------------+
//|                                                  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:


Do not double/triple/quadruple post!

I have deleted your duplicate posts.

 

Hello. Could anyone help me to place buy and sell orders when arrows appear on the chart? I'm using arrows from WADDAH atr explosion indicator. any Help would be great. Thanks

<ex4 file deleted>

 
Hello can you help me. on how can i add design on my chart template  and show this like the image attached, and how can i add threshold like stopping the trade when certain amount is reach or the account balance is reach to x amount..attached is my code and please feel free to add more and modify..
Files:
Capture.JPG  128 kb
 
Eustorgio Trentino:
Hello can you help me. on how can i add design on my chart template  and show this like the image attached, and how can i add threshold like stopping the trade when certain amount is reach or the account balance is reach to x amount..attached is my code and please feel free to add more and modify..

Do not double/triple post!!

I have deleted your duplicates.

 
Guys need help will it be possible to back-test  previous year like from January 2020 - December 2020? because i'm using MT4 and when i back-test previous it won't work 
 
Eustorgio Trentino:
Guys need help will it be possible to back-test  previous year like from January 2020 - December 2020? because i'm using MT4 and when i back-test previous it won't work 

As long as you have enough history data for the symbol, of course you can.

 
Hi  , Hi everybody how are you  ... I hope you have good health in these difficult times

There is the possibility to add the option of JMA Jurik moving average ??

I thank a good programmer with a good heart can help me without asking for remuneration in return ... I thank you in advance  ,  ... greetings to all... Thank you

.. greetings
Files:
 
Thanks all for this examples.
 
ok 
Reason: