How to code? - page 30

 

Dear Expert Advisors! pl. advise on refreshing buffers code

Dear Experts Advisors! Please give me advise on refreshing buffers (just good advise)

there is code (patch, fix, upgrade) by Raff 4 multitimeframe (MTF) indicators, working pretty good;

what could be similar code you can add to regular (not mtf) indicators?

If possible, please, give example,

thank you

//---- Refresh buffers +++++++++++++++++++++ upgrade by Raff

if (TimeFrame>Period()) {

int PerINT=TimeFrame/Period()+1;

datetime TimeArr[]; ArrayResize(TimeArr,PerINT);

ArrayCopySeries(TimeArr,MODE_TIME,Symbol(),Period( ));

for(i=0;i=TimeArray[0]) {

//----

/************************************************** ***

Refresh buffers: buffer = buffer[0];

************************************************** ****/

Buffer1= Buffer1[0];

Buffer2= Buffer2[0];

Buffer3= Buffer3[0];

//----

} } }

//+++++++++++++++++++++++++++++++++++++++++ Raff ++++++

 

Code to Pause between actions in an EA Needed

What is the proper way to put a pause statement in an EA? Would it be the same for an indicator??

Dave <<<
 

sleep(1000);

1000 is 1000 milliseconds, or 1 second.

 

Small thread about it with code https://www.mql5.com/en/forum/174203

 

How to code this alert?

I'm trying to code a set of alerts including some RSI related, but actually i'm stuck at this point:

I slimply cant figure how to make the code to alert the point of re-entry in 30-70 RSI levels.

I would be very happy if someone could explain me how to do it.

Thank you for your time.

pente

 

For information:

- RSI with alert is here https://www.mql5.com/en/forum

- everything about RSI is here: https://www.mql5.com/en/forum

- the other RSI with alert is in elite indicators' thread in elite section.

-----------------------------

pentesileia,

I am not a coder but I know that it is something with two values of the indicator.

For example, we have i bar and i+1 bar (it is the same as 1st bar and 2nd bar).

So, RSI on i bar is below 70 and RSI of i+1 bar (previous bar) is above 70. It is the crossing. And opposite for 30 for example.

It is not difficult to code.

 

newdigital,

Thank you for your fast and wise answer!

I'm sure I'll be able to get my goal with such info.

pente

 
 

How to increase lot size after loss??

Does anyone know enough about programing an EA to help me out a little.

I have a pretty good EA but would like to have it increase the lot size only after a drop in equity or a loosing trade but I'm not sure how to program that in.

Can anyone give me some help??

Thanks!!

 

Chick Gosling

How can i create this code from metastock to MT4

factor:= 2.43;

sp:= 3;

ip:= 10;

lp:= 16;

sl:= (Mov(CLOSE,sp,S)-Mov(CLOSE,ip,S))/(((((Mov(CLOSE,ip,S)+factor*Mov(CLOSE,ip,S)

)*0.333)-Mov(CLOSE,ip,S))/100));

ml:= Mov(sl,lp,S);

ml;

sl;

Reason: