Ask! - page 162

 
increase:
How can I choose one line at a time to process when I have a number of lines? something like

if (Askval5) { buy=1;sell=0; }

if (Askval4) { buy=1;sell=0; }

if (Askval3) { buy=1;sell=0; }

if (Askval2) { buy=1;sell=0; }

if (Askval1) { buy=1;sell=0; }

Well I got it to work using time delay, but there must be a better way

if (TimeLocal() >= _time_waiting && Ask > val6 + reversegap) {buy=1;sell=0;_time_waiting = TimeLocal() + 480;}

if (TimeLocal() >= _time_waiting && Bid > val5 - reversegap && Bid < val6) {buy=0;sell=1;_time_waiting = TimeLocal() + 480;}

if (TimeLocal() >= _time_waiting && Ask > val4 + reversegap && Ask < val5) {buy=1;sell=0;_time_waiting = TimeLocal() + 480;}

 

Take a look at if/else statements or switch statements. Have a look in some EA's you already have and also the help file.

Lux

 
luxinterior:
Take a look at if/else statements or switch statements. Have a look in some EA's you already have and also the help file. Lux

Thanks I did but I need a bit more direction to get them working

 
increase:
How can I choose one line at a time to process when I have a number of lines? something like

if (Askval5) { buy=1;sell=0; }

if (Askval4) { buy=1;sell=0; }

if (Askval3) { buy=1;sell=0; }

if (Askval2) { buy=1;sell=0; }

if (Askval1) { buy=1;sell=0; }

It seems to me that only one of your if() statements could be true at any one time, assuming val1 - val6 all have different values.

Not exactly sure what you are asking for here.

 

Will this do what I need?

Hi

Will this code get me the RSI on top of the CCI that I need for my strategy?

I need the EA to read the RSI using "Previous Indicator's Data" from CCI.

double Buy1_1 = iCCI(NULL, 0, 10, PRICE_OPEN, Current + 0);

double Buy2_1 = iRSI(NULL, 0, 3, 7, Current + 0);

Jamal

 
wolfe:
It seems to me that only one of your if() statements could be true at any one time, assuming val1 - val6 all have different values. Not exactly sure what you are asking for here.

one is true but Ask < val6 makes Ask < val5 redundant I need to execute the appropriate zone and only that zone

 

2ma of rsi question

wolfe:
It seems to me that only one of your if() statements could be true at any one time, assuming val1 - val6 all have different values. Not exactly sure what you are asking for here.

Hi wolfe,

Some time ago you writes an indicator "2ma of rsi" and now I am trying to get the data from them to a robot, I want to ask if this is the correct line to get the RSI value

double rsi1=iCustom(symbol,timeframe,"2MA_RSI",RSI_Timeframe,RSI_Period,0,bar);

Because I am not getting the right values, for example never get the 80 value in the variable but touch the 80 line of the indicator.

Please let me know.

Thanks

pachecus.

 

firebird and nonlagma v7

can anyone please add a code to firbird so it can trade in 1 or 5 minutes charts, following the Nonlagma signal in one hour chart?

if nonlagma green in one hour chart firebird goes only long in 1 or 5 mins chart and viceversa

thanx in advance

 

firebird and nonlagma v7

can anyone please add a code to firbird so it can trade in 1 or 5 minutes charts, following the Nonlagma signal in one hour chart?

if nonlagma green in one hour chart firebird goes only long in 1 or 5 mins chart and viceversa

thanx in advance

 

How to sort a two dimension array?

codersguru:
Hi folks,

I've got a lot of private messages asking me for helping with some pieces of code.

Here you can post your questions related to MQL4, and I'll do my best to answer them.

Dear Guru,

I am using a two dimension array, say, ZigZag[2][100]. and I want to sort by the first dimension. I use the following function:

ArraySort(ZigZag,WHOLE_ARRAY,0,MODE_DESCEND);

but it seem neither sort by first dimention, nor by second dimension. is there anybody here can help me?

Thanks a lot