MQL4 Learning - page 96

 

Alerts(Yes/No/Cancel,"Blah blah");

Hi, some time ago I saw some code which looked like you could instruct an ALERT to CASE Yes, No, Cancel etc but I cannot find it. Does anyone know how to code the ALERT to give alternative buttons rather than OK ?

I am sure there are many coders out there that would like to know this as well.

Many thanks in advance,

Steve.

 

Error while compiling EA

Hello!

I would like seek help from experts here that while I did the compiling from mq4 to ex4, there were errors.

Anyone knows can assist in this?

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1563:31;'case' - unexpected token

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1563:36;'146' - unexpected token

2;84;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1563:61;':' - assignment expected

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1609:31;'case' - unexpected token

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1609:36;'146' - unexpected token

2;84;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1609:61;':' - assignment expected

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1632:27;'else' - unexpected token

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1664:127;'continue' - 'break' or 'continue' used within some cycle only

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1666:33;'else' - unexpected token

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1668:127;'continue' - 'break' or 'continue' used within some cycle only

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1674:124;'continue' - 'break' or 'continue' used within some cycle only

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1681:124;'continue' - 'break' or 'continue' used within some cycle only

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1687:124;'continue' - 'break' or 'continue' used within some cycle only

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1697:128;'continue' - 'break' or 'continue' used within some cycle only

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1699:33;'else' - unexpected token

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1701:128;'continue' - 'break' or 'continue' used within some cycle only

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1707:125;'continue' - 'break' or 'continue' used within some cycle only

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1714:125;'continue' - 'break' or 'continue' used within some cycle only

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;1720:125;'continue' - 'break' or 'continue' used within some cycle only

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;3894:18;'li_20' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;3961:33;'li_0' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;3971:33;'li_28' - internal error

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4002:19;'case' - unexpected token

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4002:24;'64' - unexpected token

2;84;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4002:46;':' - assignment expected

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4060:27;'li_16' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4076:27;'li_28' - internal error

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4109:13;'case' - unexpected token

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4109:18;'64' - unexpected token

2;84;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4109:40;':' - assignment expected

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4118:44;'continue' - 'break' or 'continue' used within some cycle only

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4120:37;'continue' - 'break' or 'continue' used within some cycle only

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4129:27;'li_16' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4145:27;'li_28' - internal error

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4179:13;'case' - unexpected token

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4179:18;'64' - unexpected token

2;84;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4179:40;':' - assignment expected

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4189:44;'continue' - 'break' or 'continue' used within some cycle only

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4191:41;'continue' - 'break' or 'continue' used within some cycle only

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4200:27;'li_16' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4220:27;'li_28' - internal error

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4253:13;'case' - unexpected token

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4253:18;'64' - unexpected token

2;84;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4253:40;':' - assignment expected

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4274:33;'li_16' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4294:33;'li_28' - internal error

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4328:19;'case' - unexpected token

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4328:24;'64' - unexpected token

2;84;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4328:46;':' - assignment expected

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4330:22;'continue' - 'break' or 'continue' used within some cycle only

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4357:27;'li_16' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4374:27;'li_28' - internal error

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4405:13;'case' - unexpected token

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4405:18;'64' - unexpected token

2;84;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4405:40;':' - assignment expected

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4414:44;'continue' - 'break' or 'continue' used within some cycle only

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4416:37;'continue' - 'break' or 'continue' used within some cycle only

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4425:27;'li_16' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4442:27;'li_28' - internal error

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4473:13;'case' - unexpected token

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4473:18;'64' - unexpected token

2;84;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4473:40;':' - assignment expected

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4482:44;'continue' - 'break' or 'continue' used within some cycle only

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4484:41;'continue' - 'break' or 'continue' used within some cycle only

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4493:27;'li_16' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4514:27;'li_28' - internal error

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4548:13;'case' - unexpected token

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4548:18;'64' - unexpected token

2;84;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4548:40;':' - assignment expected

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4569:33;'li_16' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4590:33;'li_28' - internal error

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4624:19;'case' - unexpected token

2;93;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4624:24;'64' - unexpected token

2;84;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4624:46;':' - assignment expected

2;98;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4626:22;'continue' - 'break' or 'continue' used within some cycle only

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4835:15;'li_32' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4855:12;'li_32' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4887:27;'li_0' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4932:27;'li_0' - internal error

2;135;C:\Documents and Settings\User\My Documents\LiteKiller.mq4;4977:30;'li_0' - internal error

 

How to get count of bars on screen only (not on chart)

Hi everyone.

Does anyone know of a way to compute the bar count of the bars ONLY on the screen, not the total bars on the chart?

An alternative would be to get the earliest datetime on the screen only (not on the chart).

I'm trying to make a fixed-pip grid indicator that doesn't 'shrink' up when the time on the x-axis is stretched back further into the past.

Thanks everyone,

Chris

 

your EA is a decompiled version from .ex4...

can you post original file?

 

EA multiple trade problem.

Hi there,

My EA pulls the trigger multiple times on the same bar. As soon as a trade closes, and the buy/sell signal is till there, it opens another trade.

Is there anyway to postpone the next trade, or to ensure it doesn't trade again until at least another bar has opened? How can I have it check how long it has been since the last trade closed

Your help will be greatly appreciated!

MT

 

Something like this:

extern int TradeWaitTime = 30; //minutes[/PHP]
bool TradeWait(){

int total=OrdersHistoryTotal();

for (int i = total - 1; i >= 0; i --)

{

OrderSelect(i, SELECT_BY_POS,MODE_HISTORY);

if(OrderMagicNumber() == MagicNumber && OrderSymbol()==Symbol())

{

if(OrderOpenTime() + (TradeWaitTime*60) > TimeCurrent()) return(true);

}

}

return (false);

}

then in open order function

[PHP]if(TradeWait()==true) return;
 

@ enforcer

Wish I could've come up with a solution that quick.....

You're the man, it works like a charm.

Thanks for the help,

MT

 

hi coders help please

is it possible to open an oreder lets suppose 1 lot and the splitt it into 2 different orders ? ex . enter long with 1 lot then first exit 0.5 lot at a target price and then continue with the other 0.5 lot untill the set up is met

my problem is that my code exit all conditions for an exit at close price of the bar and there is no intrabar lookup even if do not use close but bid and ask . so does with the first exit 0.5 lot at a target setted up when enter the trade .

i do not know why cuold please sambody help

is it better to make two ea s or can i do the job done on one ?

please help me out

 

Where can I lear about EA programing?

 

ask help for setting EA

i'm new and just try to write some EA but i,ve some question

1) how can we identify the price in previous bar or indicator for record to use in calculation

such as i want to compare present bar to previous 5 bar how can i identified that price at close and indicator from that bar what code that use for use at price : P1 P2 P3 P4 P5 and RSI as R1 - R5

2) if i use zigzag indicator , how can we identified every peak and every bottom as peak 1 ,2 ,3

i tried to learn from many EA but it still fail ,so could someone show me code for do that with explanation

Thks for help