PDA

View Full Version : Need some help on warning alert for ea



volvomoke
02-25-2009 11:30, 11:30 AM
Update I have question about incorporating magicnumber . I tried incorporating these . . But the ea unlocks more than 30trades at precisely the exact same moment . . .heres the codes . . .did i miss anything else ?

//Initialization
int MAGIC = 0123;

//Local Variables
I put it at all the = should(OrderSymbol()==Symbol). Here it's :

if(OrderSymbol()==Symbol()OrderMagicNumber()==Magi cNumber)






------------------------------------------------------------------------
I need some help on something . .hope all expert coders can help me

if period is apart from D1, a message box alert will head out and no trade will be made.

When the key-number at (extern double) besides the approved key, then a message box alert will head out and no trade will be made.

bmigisg
11-19-2021 04:01, 04:01 AM
Bool oktotrade;

init()oktotrade=true;

into your main segment place this code in the start

if(Stage() ! = PERIOD_D1 oktotrade)oktotrade=false;
if(! Oktotrade)
Alert(Wrong Time Frame)
return(0);



same type of set up can be utilized for your key

volvomoke
11-19-2021 05:22, 05:22 AM
I keep getting 'init' - term on global scope not permitted
'{' - semicolen anticipated
'yield' - semicolen anticipated

bmigisg
11-19-2021 06:42, 06:42 AM
Init is a function that mt4 calls when you first install an indior. The code which I listed there in my prior response ought to go beneath that function call.

If your code does not have an init function use the one below:

int init()
oktotrade=true;

volvomoke
11-19-2021 08:03, 08:03 AM
thanks . . Working now . .

volvomoke
11-19-2021 09:24, 09:24 AM
Got a brand new question regarding magicnumber

Memcegesi
11-19-2021 10:45, 10:45 AM
the ea unlocks more than 30trades in precisely the exact same time ... Post the component of your code which opens trades (the component with OrderSend) therefore it's going to be easier to find what is wrong with your EA.

volvomoke
11-19-2021 12:06, 12:06 PM
Heres the without the magical number codecode

Inserted Code OpenOrders = 0; for(cnt = 0; cnt lt; OrdersTotal(); cnt ) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderSymbol() == Symbol()) OpenOrders ;