
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello Everyone,
i need a help... i have a simple ea, but programmed for 4 digit. (For example: EUR/USD: 1,1234)
How can i use my ea 5 digit? (For example: EUR/USD: 1,12345)
Thanks:)
simpleea.mq4You can add this :
*MathPow(10,_Digits%2)
where ever you use _Point and then it will work in pips equally on 4 and 5 digit brokers
____________________
Hi mladen,
Thanks for post.
I do it this.
int CheckForOpen()
{
double L = Low;
double H = High;
double Lots = MathRound(AccountBalance()/100)/1000;
if((H-Bid>Limit*Point))
{OrderSend(Symbol(),OP_BUY,Lots,Ask,1,0,0,"",MAGICMA,0,CLR_NONE);
for(int i=1; i<5; i++){OrderSend(Symbol(),OP_BUYLIMIT,MathPow(2,i)*Lots,Ask-i*Grid*Point*MathPow(10,_Digits%2),1,0,0,"",MAGICMA,0,CLR_NONE);}
}
if((Bid-L>Limit*Point))
{OrderSend(Symbol(),OP_SELL,Lots,Bid,1,0,0,"",MAGICMA,0,CLR_NONE);
for(int j=1; j<5; j++){OrderSend(Symbol(),OP_SELLLIMIT,MathPow(2,j)*Lots,Bid+j*Grid*Point*MathPow(10,_Digits%2),1,0,0,"",MAGICMA,0,CLR_NONE);}
}
}
its true?
Hi mladen,
Thanks for post.
I do it this.
int CheckForOpen()
{
double L = Low;
double H = High;
double Lots = MathRound(AccountBalance()/100)/1000;
if((H-Bid>Limit*Point))
{OrderSend(Symbol(),OP_BUY,Lots,Ask,1,0,0,"",MAGICMA,0,CLR_NONE);
for(int i=1; i<5; i++){OrderSend(Symbol(),OP_BUYLIMIT,MathPow(2,i)*Lots,Ask-i*Grid*Point*MathPow(10,_Digits%2),1,0,0,"",MAGICMA,0,CLR_NONE);}
}
if((Bid-L>Limit*Point))
{OrderSend(Symbol(),OP_SELL,Lots,Bid,1,0,0,"",MAGICMA,0,CLR_NONE);
for(int j=1; j<5; j++){OrderSend(Symbol(),OP_SELLLIMIT,MathPow(2,j)*Lots,Bid+j*Grid*Point*MathPow(10,_Digits%2),1,0,0,"",MAGICMA,0,CLR_NONE);}
}
}
its true?Yes
But then also change the Grid parameter from 1500 to 150 or else it will try to set the price 1500 pips away from the Bid or Ask
Im using that configuration;
extern int PeriodX = 60;
extern int Limit = 50;
extern int Grid = 14;
extern int Amount = 1;
extern int LockDown = 20;
How is that configuration?
Im using that configuration;
extern int PeriodX = 60;
extern int Limit = 50;
extern int Grid = 14;
extern int Amount = 1;
extern int LockDown = 20;
How is that configuration?It will open buy and sell limits 14 pips away from ask and bid
Try it out
It will open buy and sell limits 14 pips away from ask and bid Try it out
i try... seems this...
As far as I see it is doing what it is intended to do
As far as I see it is doing what it is intended to do
Yeah mladen..
But i dont want to close the orders without profit and stoploss 14 pips
Yeah mladen.. But i dont want to close the orders without profit and stoploss 14 pips
Then add take profit and stop loss too
Then add take profit and stop loss too
im added this code;
int CheckForClose()
{
if(getProfit()>=Amount){CloseAll();}
if(LockDown>0)
{
for(int TradeNumber = OrdersTotal(); TradeNumber >= 0; TradeNumber--)
{
if (OrderSelect(TradeNumber, SELECT_BY_POS, MODE_TRADES)&&(LockDown>0))
{ int Pos=OrderType();
if((Pos==OP_BUY)&&(Bid-OrderOpenPrice()>Point*MathPow(10,_Digits%2)*LockDown)&&(OrderStopLoss() == 0))
{OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+Point,OrderTakeProfit(),0,CLR_NONE);}
if((Pos==OP_SELL)&&(OrderOpenPrice()-Ask>Point*MathPow(10,_Digits%2)*LockDown)&&(OrderStopLoss() == 0))
{OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-Point,OrderTakeProfit(),0,CLR_NONE);}
}
}
}
}
For example; EUR/USD order price 1.12345 sl/tp 1.12346
i want to sl/tp 1.12355
im not understanding whats going wrong?