Please fix this indicator or EA - page 65

 
mladen:
There is no error in that indicator so, if "Allow DLL imports" is checked in indicators properties it should work. If it does not then it is a problem of metatrader build 500 not of the indicator

had a feeling that might be the case, as i have never had a problem with the indicator before, but thought i would check here. thanks for the reply, guess its time to roll back to an earlier build.

 

myzz and mySR indicator works together and i used them to make an EA but t times the EA will refused to close open order and it won't open another order at times. someone told me that the fault is from the indicator i used for the EA.

Please, can you help me look into is and fixed it.

Thanks

Files:
 

For better understanding, please take a look at the attached picture. The EA suppose to close the order when blue do-line appears but it ignore it. you can see that the ea ignore two order/signal in the attached picture. please, help.

Files:
srea2.gif  24 kb
 
oguntosin:
myzz and mySR indicator works together and i used them to make an EA but t times the EA will refused to close open order and it won't open another order at times. someone told me that the fault is from the indicator i used for the EA.

Please, can you help me look into is and fixed it.

Thanks

oguntosin

It has a code that should close an order when opposite order should be executed already. Check your experts tab for errors (since it seems that it ends up in error instead in closing an order) and that might depend on a lot of causes

 

mladen, can you fix it?

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 Red

#property indicator_color2 DodgerBlue

#property indicator_color3 White

#property indicator_level1 30

#property indicator_level2 70

#property indicator_minimum 0

#property indicator_maximum 100

//----

extern int TimeFrame=5;

extern int TimeFrame2=30;

extern int TimeFrame3=60;

//----

double ExtMapBuffer1[];

double ExtMapBuffer2[];

double ExtMapBuffer3[];

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicator line

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(2,ExtMapBuffer3);

SetIndexStyle(2,DRAW_LINE);

//---- name for DataWindow and indicator subwindow label

switch(TimeFrame)

{

case 1 : string TimeFrameStr="Period_M1"; break;

case 5 : TimeFrameStr="Period_M5"; break;

case 15 : TimeFrameStr="Period_M15"; break;

case 30 : TimeFrameStr="Period_M30"; break;

case 60 : TimeFrameStr="Period_H1"; break;

case 240 : TimeFrameStr="Period_H4"; break;

case 1440 : TimeFrameStr="Period_D1"; break;

case 10080 : TimeFrameStr="Period_W1"; break;

case 43200 : TimeFrameStr="Period_MN1"; break;

default : TimeFrameStr="Current Timeframe";

}

IndicatorShortName("MTF_III ("+TimeFrameStr+")");

}

//----

return(0);

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

//| MTF RSI |

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

int start()

{

int i,counted_bars = IndicatorCounted();

if(counted_bars<0) return(-1);

if(counted_bars>0) counted_bars--;

int limit=Bars-counted_bars;

limit=MathMax(limit,3*TimeFrame /Period());

limit=MathMax(limit,3*TimeFrame2/Period());

limit=MathMax(limit,3*TimeFrame3/Period());

limit=MathMin(limit,Bars-1);

for(i=limit;i>=0;i--)

{

ExtMapBuffer1=((iHigh(NULL, TimeFrame, iHighest(NULL, TimeFrame, MODE_CLOSE, 4,iBarShift(NULL,TimeFrame ,Time))) - iClose(0,0,iBarShift(NULL,TimeFrame ,Time)))) ;

ExtMapBuffer2=((iHigh(NULL, TimeFrame2, iHighest(NULL, TimeFrame2, MODE_CLOSE, 4,iBarShift(NULL,TimeFrame2 ,Time))) - iClose(0,0,iBarShift(NULL,TimeFrame2 ,Time)))) ;

ExtMapBuffer3=((iHigh(NULL, TimeFrame3, iHighest(NULL, TimeFrame3, MODE_CLOSE, 4,iBarShift(NULL,TimeFrame3 ,Time))) - iClose(0,0,iBarShift(NULL,TimeFrame3 ,Time)))) ;

return(0);

}}

 
k3rn3l:
mladen, can you fix it?

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 Red

#property indicator_color2 DodgerBlue

#property indicator_color3 White

#property indicator_level1 30

#property indicator_level2 70

#property indicator_minimum 0

#property indicator_maximum 100

//----

extern int TimeFrame=5;

extern int TimeFrame2=30;

extern int TimeFrame3=60;

//----

double ExtMapBuffer1[];

double ExtMapBuffer2[];

double ExtMapBuffer3[];

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicator line

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(2,ExtMapBuffer3);

SetIndexStyle(2,DRAW_LINE);

//---- name for DataWindow and indicator subwindow label

switch(TimeFrame)

{

case 1 : string TimeFrameStr="Period_M1"; break;

case 5 : TimeFrameStr="Period_M5"; break;

case 15 : TimeFrameStr="Period_M15"; break;

case 30 : TimeFrameStr="Period_M30"; break;

case 60 : TimeFrameStr="Period_H1"; break;

case 240 : TimeFrameStr="Period_H4"; break;

case 1440 : TimeFrameStr="Period_D1"; break;

case 10080 : TimeFrameStr="Period_W1"; break;

case 43200 : TimeFrameStr="Period_MN1"; break;

default : TimeFrameStr="Current Timeframe";

}

IndicatorShortName("MTF_III ("+TimeFrameStr+")");

}

//----

return(0);

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

//| MTF RSI |

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

int start()

{

int i,counted_bars = IndicatorCounted();

if(counted_bars<0) return(-1);

if(counted_bars>0) counted_bars--;

int limit=Bars-counted_bars;

limit=MathMax(limit,3*TimeFrame /Period());

limit=MathMax(limit,3*TimeFrame2/Period());

limit=MathMax(limit,3*TimeFrame3/Period());

limit=MathMin(limit,Bars-1);

for(i=limit;i>=0;i--)

{

ExtMapBuffer1=((iHigh(NULL, TimeFrame, iHighest(NULL, TimeFrame, MODE_CLOSE, 4,iBarShift(NULL,TimeFrame ,Time))) - iClose(0,0,iBarShift(NULL,TimeFrame ,Time)))) ;

ExtMapBuffer2=((iHigh(NULL, TimeFrame2, iHighest(NULL, TimeFrame2, MODE_CLOSE, 4,iBarShift(NULL,TimeFrame2 ,Time))) - iClose(0,0,iBarShift(NULL,TimeFrame2 ,Time)))) ;

ExtMapBuffer3=((iHigh(NULL, TimeFrame3, iHighest(NULL, TimeFrame3, MODE_CLOSE, 4,iBarShift(NULL,TimeFrame3 ,Time))) - iClose(0,0,iBarShift(NULL,TimeFrame3 ,Time)))) ;

return(0);

}}

k3rn3l

this is the corrected one

Files:
corrected.gif  37 kb
_test.mq4  3 kb
 

Hi Mladen and Mr Tools

please can you have a quick look at this Macd - as its printing multiple arrows everytime MT4 is opened

it seems ok on normal charts - except for the repainting

but the problem occurs on offline charts

ive tried loads of things and added the offline chart in the list etc, but nothing seems to work

it seems to of got worse since reducing the bars in MT4

but tried adding Bars to count from Bars_Count and also did nt make any difference either

also if possible please can you add the rest of the text equation code as ive tried to add it on this, but it would nt have it

so just added it on the end of the arrow code, and although it kind of works, it does nt work too well

any help appreciated as its starting to drive me nuts....

thanks very much

Files:
 
WR1:
Hi Mladen and Mr Tools

please can you have a quick look at this Macd - as its printing multiple arrows everytime MT4 is opened

it seems ok on normal charts - except for the repainting

but the problem occurs on offline charts

ive tried loads of things and added the offline chart in the list etc, but nothing seems to work

it seems to of got worse since reducing the bars in MT4

but tried adding Bars to count from Bars_Count and also did nt make any difference either

also if possible please can you add the rest of the text equation code as ive tried to add it on this, but it would nt have it

so just added it on the end of the arrow code, and although it kind of works, it does nt work too well

any help appreciated as its starting to drive me nuts....

thanks very much

WR1

It uses future values in calculation and that is why it repaints.

 

Hi Mladen - its not the repainting that's an issue, im used to that, and only use it very sparingly

its the multiple arrows problem when turning on MT4

im thinking its got something to do with the timeframe to string part of the code or the lack of past data as have had to reduce the bars in chart in MT4 options

as otherwise MT4 is freezing in the US session - the freezing is now nr gone - but have the multiple arrow problem instead and have to manually click - indicators / ok etc - to get rid on many MT4s a few times a day

so its becoming abit of a pain

please can you add in the correct text equation, if possible (as you did on the slope)

as sometimes it gets stuck in the wrong direction as it is

Thanks alot

 
WR1:
Hi Mladen - its not the repainting that's an issue, im used to that, and only use it very sparingly

its the multiple arrows problem when turning on MT4

im thinking its got something to do with the timeframe to string part of the code or the lack of past data as have had to reduce the bars in chart in MT4 options

as otherwise MT4 is freezing in the US session - the freezing is now nr gone - but have the multiple arrow problem instead and have to manually click - indicators / ok etc - to get rid on many MT4s a few times a day

so its becoming abit of a pain

please can you add in the correct text equation, if possible (as you did on the slope)

as sometimes it gets stuck in the wrong direction as it is

Thanks alot

Found one other issue that could have caused it. Fixed that issue

But when it comes to offline chart, I can not guarantee anything. Try it out and see if it is OK

Files:
Reason: