How to code? - page 51

 

i need a little help.. how do i make it work? i tried but it won't read the mins? i i should use something else aside from TimeHour but what?

if (TimeHour (Clocks) == 7:15) {B = 1; }

if (TimeHour (Clocks) == 7:30) {B = 2;}

if (TimeHour (Clocks) == 7:45) {B= 3;}

if (TimeHour (Clocks) == 8) {B = 4;}

if (TimeHour (Clocks) == 8:15) {B = 5;}

if (TimeHour (Clocks) == 8:30) {B = 6;}

 

Maybe you meant something like the following:

if ( TimeHour( Clocks ) == 7 ) {

B = MathFloor( TimeMinute( Clocks ) / 15 );

} else if ( TimeHour( Clocks ) == 8 ) {

B = MathFloor( TimeMinute( Clocks ) / 15 ) + 4;

}
 
ralph.ronnquist:
Maybe you meant something like the following:
if ( TimeHour( Clocks ) == 7 ) {

B = MathFloor( TimeMinute( Clocks ) / 15 );

} else if ( TimeHour( Clocks ) == 8 ) {

B = MathFloor( TimeMinute( Clocks ) / 15 ) + 4;

}

Or maybe

if (TimeHour(Clocks) == 7)

{

switch (TimeMinute(Clocks)

{

case 15 : B = 1;

break;

case 30 : B = 2;

break;

case 45 : B = 3;

}

}

if (TimeHour(Clocks) == 8)

{

switch (TimkeMinute(Clocks)

{

case 0 : B = 4;

break;

case 15 : B = 5;

break;

case 30 : B = 6;

}

}

Otherwise 7:17 would also set a value of 1 to B.

Robert

 
Beno:
Gidday Wolfe

Attached is The Abyss EA it needs some work doing to it. I am still working on it but some more help By some one who knows what they are doing would be great.

cheers

Beno

One thing I thought id tell you, trendmanager is the same as Heiken Ashi, just once again with different settings like Heiken Ashi Smoothed has different settings than the standard Heiken Ashi in MT4.

It is a "MA cross" colored into the bars instead of lines.

So you have 2 MA crosses with different settings.

 

Thanks for that kjhfdgjfhdghdf

Well my grandmother was right you do learn something new every day I did not think of that.

back to drawing board.

 

Yeh I didn't think of it either for a while.Then seen its the same thing just different settings.Many things on here you'll see look totally different but are the same as some old thing, with different colors and looks and settings.

 

Previous Tick Data?

Is there a way, more like what is the best way, to code into an EA access to previous tick data?

Just like you can access the high of the bar 3 bars ago by using High[3];

I would like to access previous ticks. Could you use the Bid for this? So you could have Bid[0], Bid[1], Bid[2] and so on?

Thanks.

 
MrPip:
Or maybe

if (TimeHour(Clocks) == 7)

{

switch (TimeMinute(Clocks)

{

case 15 : B = 1;

break;

case 30 : B = 2;

break;

case 45 : B = 3;

}

}

if (TimeHour(Clocks) == 8)

{

switch (TimkeMinute(Clocks)

{

case 0 : B = 4;

break;

case 15 : B = 5;

break;

case 30 : B = 6;

}

}

Otherwise 7:17 would also set a value of 1 to B.

Robert

Thanks again robert.. i am still learning to make an EA.. and what i made always turns out negative.. learn from mistakes that's what i say..

ralph.ronnquist, thanks also.. but it is not what i need..

 

Gidday Wolfe

Attached is The Abyss EA it needs some work doing to it. I am still working on it but some more help By some one who knows what they are doing would be great.

cheers

Beno

 

What is "clock"? as far I know there's no "clock" function in MQL4.

You can try this

if(TimeHour(TimeCurrent())==7)

{

if(TimeMinute(TimeCurrent())==15) B== 1;

if(TimeMinute(TimeCurrent())==30) B== 2;

if(TimeMinute(TimeCurrent())==45) B== 3;

}

if(TimeHour(TimeCurrent())==8)

{

if(TimeMinute(TimeCurrent())==0) B== 4;

if(TimeMinute(TimeCurrent())==15) B== 5;

if(TimeMinute(TimeCurrent())==30) B== 6;

}