How to code? - page 17

 

U initialized bars variable before start function - in global section?

Try to use if (Bars>bars)

 
 

mmf,

why do you think that it will be a profitable system? Do you have manual backtest results? I think this will kill an account.

From looking at the code, I think Solar Wind repaints the past.

Maji

 

I read THAT code I can`t understand the way it works but follow me through the index found that changed its signs and i found the solution to that>

do at the 0.2 level and the level at the 0.2-and in contact with the positive and buying in contact with the negative sale.

 
BaasHarm:
Hi guys,

I've been following this forum for a while now and picked up a lot of valuable lessons already. Especially thanks to Coder Guru for the quickstart to MQL4.

I'm managed to build a few simple EA's just to get familar with MT4. Now I want to start a new project but I got stuck.

I want to enter a trade after a 10 pip move, not based on any indicator, just on the tick data, if price moves up 10 pips (eventually with a time limit), I want to enter long and and if it moves down, go short. I don't want to use the bar open or close as this may be late or miss some big moves. What I need is how to "freeze" the starting price to compare to the bid/ask to see when the condition is met.

Any suggestions?

Why don't you use pending orders? They are very similar to your idea!

http://www.metatrader.info/node/80

 

Help needed - How to code MQL MT4 for Breakeven after "x" pips?

Hi,

Thanks in advance.

Does anyone know the code MQL MT4 to incorporate a

Breakeven after profit has cross "x" pips?

Thanks thanks thanks.

ed

 

Piece of code that should work

This little piece of code is looking to give the % change of the current bar as compared to the daily bar open. I don't know why it won't work...I can get it to output AmtChange and also O (which is the open) and the numbers given are correct. However when I combine them into the line (AmtChange/O)/*100 the code does not output anything. If anyone can find my problem please point it out to me before I pull my hair out!!!

int start()

{

i = Bars;

AmtChange = 0;

while(i >= 0)

{

if(i==Bars)

{

O=Open;

}

else

{

if(TimeDayOfWeek(Time)!=TimeDayOfWeek(Time))

{

NO=Open;

O=NO;

}

}

AmtChange = Close - O;

DayPctChange = (AmtChange/O)*100;

i--;

}

return(0);

}

Thank you.

BW

 

I just wanted to add that I was writing a correlation indicator last week that exhibited similar behavior...I checked every number going into the final calculation, but for some reason it was not outputting anything. Is there some kind of syntax violation I'm repeatedly committing? Again, thanks for any help offered.

BW

 
bwilhite:
I just wanted to add that I was writing a correlation indicator last week that exhibited similar behavior...I checked every number going into the final calculation, but for some reason it was not outputting anything. Is there some kind of syntax violation I'm repeatedly committing? Again, thanks for any help offered. BW

It's possible that there is some error in the declaration of variables / buffers, so post the full indic here. Otherwise, check first if O != 0, because it can happen that a bar is missing or for whatever reason Open = 0, then the whole indic stucs.

 
Michel:
It's possible that there is some error in the declaration of variables / buffers, so post the full indic here. Otherwise, check first if O != 0, because it can happen that a bar is missing or for whatever reason Open = 0, then the whole indic stucs.

I'll check this first and then post the indicator. I don't think the problem is in the declarations. Thanks for the reply.

BW

Reason: