Download MetaTrader 5

two ea two chart

To add comments, please log in or register
Download MetaTrader 5 mobile version and trade from anywhere in the world!
yilmazkahya
311
yilmazkahya 2013.12.26 10:03 
i use two ea with different two 5m chart. both of them eur/usd. but second isn't work. i use diffent magic number. please help me :/ can i use different ea's in the same metatrader ?
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2013.12.26 10:12  
yilmazkahya:
i use two ea with different two 5m chart. both of them eur/usd. but second isn't work. i use diffent magic number. please help me :/ can i use different ea's in the same metatrader ?
Yes you can . . .
yilmazkahya
311
yilmazkahya 2013.12.26 10:25  

first ea is ok. second ea is working on back tests but it isn't work in real. what is wrong ? how can i fix this problem ?

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2013.12.26 10:32  
yilmazkahya:

first ea is ok. second ea is working on back tests but it isn't work in real. what is wrong ? how can i fix this problem ?

How on earth do you expect anyone to give an answer . . . you haven't shown any code. Did you write the EA? does it handle 4 and 5 digits properly ? does it handle ECN vs non ECN correctly ?
yilmazkahya
311
yilmazkahya 2013.12.26 10:46  

it's codes. i use this ea at nights. it's no problem ecn because i use ordermodify for add tp or sl. i want use my first ea on day. and use this at nights. but second isn't work. it works in backtests.

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2013.12.26 10:57  
yilmazkahya:

it's codes. i use this ea at nights. it's no problem ecn because i use ordermodify for add tp or sl. i want use my first ea on day. and use this at nights. but second isn't work. it works in backtests.


OK, you need to add error checking to your code . . . you have none, it's a very bad idea, you should read and implement this: What are Function return values ? How do I use them ?

Does Hour() work correctly for you ? other people have had problems with it . .

if (SirtlanType==1 && sirtlanalis<1 && sirtlansatis<1 && (SpreadSiniri/10000)>=spred && (  Hour() <3 || Hour()  >22))
{
OrderSend(Symbol(),OP_BUY ,Lots,Ask,0,0,0,"Buy ",Magic5,0,Green); 
}

if (SirtlanType==2 && sirtlanalis<1 && sirtlansatis<1 && (SpreadSiniri/10000)>=spred && (  Hour() <3 || Hour()  >22))
{
OrderSend(Symbol(),OP_SELL,Lots,Bid,0,0,0,"Sell",Magic6,0,Green); 
}

instead use . . .

if (SirtlanType==1 && sirtlanalis<1 && sirtlansatis<1 && (SpreadSiniri/10000)>=spred && (  TimeHour(TimeCurrent()) < 3 || TimeHour(TimeCurrent()) > 22))
{
OrderSend(Symbol(),OP_BUY ,Lots,Ask,0,0,0,"Buy ",Magic5,0,Green); 
}

if (SirtlanType==2 && sirtlanalis<1 && sirtlansatis<1 && (SpreadSiniri/10000)>=spred && (  TimeHour(TimeCurrent()) < 3 || TimeHour(TimeCurrent()) > 22))
{
OrderSend(Symbol(),OP_SELL,Lots,Bid,0,0,0,"Sell",Magic6,0,Green); 
}
yilmazkahya
311
yilmazkahya 2013.12.26 11:00  
i thinks i solved this with your contribution. it was about magicnumber problem. thank you raptor. always you answer me and i m learing something.
Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2013.12.26 11:43  
yilmazkahya:
i thinks i solved this with your contribution. it was about magicnumber problem. thank you raptor. always you answer me and i m learing something.
Glad to have helped . . . please read about What are Function return values ? How do I use them ? it's important and most useful just when you need it the most.
To add comments, please log in or register