Jump to content

THEY HAVE DONE IT forexbestindicator


Recommended Posts

  • 8 months later...

Re: THEY HAVE DONE IT forexbestindicator

 

this should work the same.....enjoy

 

//+------------------------------------------------------------------+
//|                                   Copyright © 2010, Ivan Kornilov|
//|                                                    TrendValue.mq4|
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, Ivan Kornilov. All rights reserved."
#property link "[email protected]"

#property indicator_chart_window
#property indicator_buffers 5
#property indicator_color1 Lime
#property indicator_color2 Magenta

extern int period = 2;
extern double shiftPercent = 0.02;
extern int shift = 0;
extern int atrPeriod = 5;
extern double atrSensitivity = 2.2;

double upValue[];
double downValue[];

double highMovingAverages[];
double lowMovingAverages[];
double buffer[];

int init() {
  SetIndexStyle(0, DRAW_LINE, EMPTY, 2);
  SetIndexBuffer(0, upValue);
  SetIndexLabel(0, "Up Value");
  
  SetIndexStyle(1, DRAW_LINE, EMPTY, 2);
  SetIndexBuffer(1, downValue);
  SetIndexLabel(1, "Down Value");
  
  IndicatorDigits(Digits + 1);   
  SetIndexBuffer(2, buffer);
  SetIndexStyle(2, DRAW_NONE);
  
  SetIndexBuffer(3, highMovingAverages);
  SetIndexStyle(3, DRAW_NONE);
  SetIndexBuffer(4, lowMovingAverages);
  SetIndexStyle(4, DRAW_NONE);
  IndicatorShortName("Trand Value (" + period + "," + shiftPercent+ ")");
  return (0);
}

int start() {
  if (Bars <= period) { 
       return (0);
  }
  int indicatorCounted = IndicatorCounted();
  if (indicatorCounted < 0) { 
       return (-1);
  }
  if (indicatorCounted > 0) {
       indicatorCounted--;
  }
  int limit = Bars - indicatorCounted;
  for (int i = limit-1; i >= 0; i--) {
     double atr = iATR(NULL, 0, atrPeriod, 0) * atrSensitivity;
     highMovingAverages[i] = iMA(NULL, 0, period, shift, MODE_LWMA, PRICE_HIGH, i) * (1 + shiftPercent / 100) + atr * atrSensitivity;
     lowMovingAverages[i] = iMA(NULL, 0, period, shift, MODE_LWMA, PRICE_LOW, i) * (1 - shiftPercent / 100) - atr * atrSensitivity;
     
     buffer[i] = buffer[i + 1];
     if (Close[i] > highMovingAverages[i + 1]) {
       buffer[i] = 1;
     }
     if (Close[i] < lowMovingAverages[i + 1]) {
       buffer[i] = -1;
     }
     if (buffer[i] > 0.0) {
        if (lowMovingAverages[i] < lowMovingAverages[i + 1]) {
           lowMovingAverages[i] = lowMovingAverages[i + 1];
        }
        
        /*
        if (highMovingAverages[i] < highMovingAverages[i + 1]) {
           highMovingAverages[i] = highMovingAverages[i + 1];
        }
        */
        upValue[i] = lowMovingAverages[i];
        downValue[i] = EMPTY_VALUE;
       
     } else {
        if (highMovingAverages[i] > highMovingAverages[i + 1]) {
           highMovingAverages[i] = highMovingAverages[i + 1];
        }
        
        /*  
        if (lowMovingAverages[i] > lowMovingAverages[i + 1]) {
           lowMovingAverages[i] = lowMovingAverages[i + 1];
        }*/
        
        downValue[i] = highMovingAverages[i];
        upValue[i] = EMPTY_VALUE;
     }
  }
}

Link to comment
Share on other sites

Re: THEY HAVE DONE IT forexbestindicator

 

They always put trending markets pic on sale page. ANY system/method/indicator can work in trending markets, range is the problem for this indis.

 

30-day INDICATOR DEMO is $65

http://www.forexbestindicator.com/?page=order&keyword=Try%20Forex%20Best%20Indicator%2030%20Days

Link to comment
Share on other sites

Re: THEY HAVE DONE IT forexbestindicator

 

this should work the same.....enjoy

 

//+------------------------------------------------------------------+

//| Copyright © 2010, Ivan Kornilov|

//| TrendValue.mq4|

//+------------------------------------------------------------------+

#property copyright "Copyright © 2010, Ivan Kornilov. All rights reserved."

#property link "[email protected]"

 

#property indicator_chart_window

#property indicator_buffers 5

#property indicator_color1 Lime

#property indicator_color2 Magenta

 

extern int period = 2;

extern double shiftPercent = 0.02;

extern int shift = 0;

extern int atrPeriod = 5;

extern double atrSensitivity = 2.2;

 

double upValue[];

double downValue[];

 

double highMovingAverages[];

double lowMovingAverages[];

double buffer[];

 

int init() {

SetIndexStyle(0, DRAW_LINE, EMPTY, 2);

SetIndexBuffer(0, upValue);

SetIndexLabel(0, "Up Value");

 

SetIndexStyle(1, DRAW_LINE, EMPTY, 2);

SetIndexBuffer(1, downValue);

SetIndexLabel(1, "Down Value");

 

IndicatorDigits(Digits + 1);

SetIndexBuffer(2, buffer);

SetIndexStyle(2, DRAW_NONE);

 

SetIndexBuffer(3, highMovingAverages);

SetIndexStyle(3, DRAW_NONE);

SetIndexBuffer(4, lowMovingAverages);

SetIndexStyle(4, DRAW_NONE);

IndicatorShortName("Trand Value (" + period + "," + shiftPercent+ ")");

return (0);

}

 

int start() {

if (Bars <= period) {

return (0);

}

int indicatorCounted = IndicatorCounted();

if (indicatorCounted < 0) {

return (-1);

}

if (indicatorCounted > 0) {

indicatorCounted--;

}

int limit = Bars - indicatorCounted;

for (int i = limit-1; i >= 0; i--) {

double atr = iATR(NULL, 0, atrPeriod, 0) * atrSensitivity;

highMovingAverages[i] = iMA(NULL, 0, period, shift, MODE_LWMA, PRICE_HIGH, i) * (1 + shiftPercent / 100) + atr * atrSensitivity;

lowMovingAverages[i] = iMA(NULL, 0, period, shift, MODE_LWMA, PRICE_LOW, i) * (1 - shiftPercent / 100) - atr * atrSensitivity;

 

buffer[i] = buffer[i + 1];

if (Close[i] > highMovingAverages[i + 1]) {

buffer[i] = 1;

}

if (Close[i] < lowMovingAverages[i + 1]) {

buffer[i] = -1;

}

Can someone please upload this indicator to a mirror. multiupload.com prefferably.

.....SELFISHNESS IS A DISEASE.....
Link to comment
Share on other sites

Re: THEY HAVE DONE IT forexbestindicator

 

Just copy and paste the code to notepad, and save.

 

Then change the extension to .mq4.

 

Put the file in indicator folder and start mt4.

Thanks for this hint.

Makes it easier.

 

I always had an EA or indicator opened in Mt4, deleted all content,

then copied and pasted the posted code into the clean window

and saved it with a new name.

Compiled it too to test if it gives errors.

 

But your method is faster. =D>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...