Coding help - page 376

 
mladen:
Here is the version that works : abc_nmc.mq4

Dear mladen could you help me?

thank you

 
thegatan:
dear friend,

i need some modification from standart bollinger band with detail like picture:

the value is from london open ( could be set timer), and from any of pair

thank you very much for your help

thegatan

I am afraid that I do not understand what is what you need

 
camaropeti:
You are very professional, but I dont' understand the code language even if you say what is what.

I not want write codes.

I happy, that I understand lot of functions on fxdreema, and I can create simple EAs, and not need coding.

I'm not sure, but I think in your code you said, that the stoch will working if I change the timeframe in the metatrader the indicator will change for that timeframe. Onether words, the indicator's timeframe is same what I set in the metatrader chart timeframe. Or maybe one specified timeframe

The multitimeframe I mean like what I wrote on the fx dreema forum. I copy for here:

"for example there is the stochastatic oscillator and I make an EA what see only that. The Stoch... is on M15 timeframe going down, M5 timeframe is going down, but M1 timeframe going up.

In this case If EA see only the 1 minute timeframe (The actual what setting on metatrader), it want buy, but the good strategy is waiting while the M1 timefrmae going down again, and sell.

I want that see M1, M5, M15 timeframes all together, and start trading when the indicator is same direction on every timeframe."

I mean the every timeframe that M1- M15

Please read the posts about that : there is no simpler way of explaining how a multi time frame indicator works from that. Since multi time frame is a way how indicators values for different time frames is collected from a code, there is no way how it can be done without coding example - and you have a lots and lots of multi time frame indicators at this thread https://www.mql5.com/en/forum/173574That line of code is showing you exactly what you need to do in order to get any time frame value of stochastic. It does not get simpler than that

 
mladen:
Here is the version that works :

.

What have you changed in the code?

 
popej30:
. What have you changed in the code?

See the last couple of lines of the code

 
razo:
Hi guys,

Could anyone please help me fix this one indicator ?

I tried to make it work on Bar Open,it compiles ok, looks ok in Strategy Tester ... but it fails in real account.. draws correct legs .. but sometimes it jumps one candle back and stops on Close [ or around close ] of the bar instead of Open.. WTH ?

Here's the code ( ZigZag Open Sar )

#property indicator_chart_window

#property indicator_buffers 3

#property indicator_color1 Gray

#property indicator_color3 Orange

extern double Step=0.02;

extern double Maximum=0.2;

extern bool ExtremumsShift=1;

extern int History=0;

//--

double Peak[],

Trough[],

SAR[];

//=============================================================

int init()

{

SetIndexBuffer(0,Peak);

SetIndexStyle(0,DRAW_ZIGZAG);

SetIndexLabel(0,"Peak");

SetIndexEmptyValue(0,0.0);

SetIndexBuffer(1,Trough);

SetIndexStyle(1,DRAW_ZIGZAG);

SetIndexLabel(1,"Trough");

SetIndexEmptyValue(1,0.0);

SetIndexBuffer(2,SAR);

SetIndexStyle(2,DRAW_ARROW);

SetIndexArrow(2,159);

SetIndexLabel(2,"SAR");

SetIndexEmptyValue(2,0.0);

return(0);

}

//=============================================================

int start()

{

static int BarsPrev;

bool MissBars=Bars-BarsPrev>1;

bool NewBar=Bars-BarsPrev==1;

if(MissBars && BarsPrev!=0) BarsPrev=reinit();

int limit=Bars-BarsPrev-(BarsPrev==0); BarsPrev=Bars;

if(History!=0 && limit>History) limit=History-1;

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

{

SAR=iSAR(NULL,0,Step,Maximum, i);

double mid[2];

mid[0]=(Open+Open)/2;

mid[1]=(Open+Open)/2;

static int j;

static bool dir;

static double h,l;

int shift;

if(i>0) j++;

if(dir)

{

if(h<Open) {h=Open; j=NewBar;}

if(SARmid[0])

{

shift=i+ExtremumsShift*(j+NewBar);

Peak[shift]=h;

dir=0;

l=Open; j=0;

}

}

else

{

if(l>Open) {l=Open; j=NewBar;}

if(SAR>=mid[1] && SAR<mid[0])

{

shift=i+ExtremumsShift*(j+NewBar);

Trough[shift]=l;

dir=1;

h=Open; j=0;

}

}

}

// if(MissBars) Print("limit: ",limit," Bars:",Bars," IndicatorCounted: ",IndicatorCounted());

return(0);

}

//=============================================================

//

int reinit()

{

ArrayInitialize(Peak,0.0);

ArrayInitialize(Trough,0.0);

ArrayInitialize(SAR,0.0);

return(0);

}

Thanks in advance !

Hi Mladen,any word of advice on this one ?

Thank you !

 
razo:
Hi Mladen,any word of advice on this one ? Thank you !

razo

Was already checking it but did not find what could cause that

Will have to start some debugging to see what happens in those cases

 
popej30:
Why works 123.mq4 ..... file ABC.mq4 not works Build 711 ? Both files code are identical. What should improve of code to file works Build 711 ?

.

123.mq4

abc.mq4

Hey

Do you know who wrote the codes?

The copyright and link information, Why has been removed?

 
Anyway:
Hey

Do you know who wrote the codes?

The copyright and link information, Why has been removed?

Don't worry, I still can recognize my code even when comments and those things (copyright and links) are removed

 

.. test test ..

Reason: