hi all i developed an ea based on rsi,i compiled it with no errors but when i foward test it doesnt take trades when the trading conditions are met.please somebody help me.
below is the code for the ea:
int start()
{
double RSI_0 = iRSI(NULL,0,14,PRICE_CLOSE,0);
double RSI_1 = iRSI(NULL,0,14,PRICE_CLOSE,1);
int ticket;
if((RSI_0 > BUYsignal) && (RSI_1 <= BUYsignal))
ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,3,SL,TP,"",magicnumber,0,Red);
if(ticket<0)
{
Print("OrderSend failed with error #",GetLastError());
return(0);
}
It must be a value problem because I can't see anything wrong with the code yet. Check the journal for errors and check the values of BUYsignal and SELLsignal by printing them out.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
hi all i developed an ea based on rsi,i compiled it with no errors but when i foward test it doesnt take trades when the trading conditions are met.please somebody help me.
below is the code for the ea:
int start()
{
double RSI_0 = iRSI(NULL,0,14,PRICE_CLOSE,0);
double RSI_1 = iRSI(NULL,0,14,PRICE_CLOSE,1);
int ticket;
if((RSI_0 > BUYsignal) && (RSI_1 <= BUYsignal))
ticket=OrderSend(Symbol(),OP_BUY,lots,Ask,3,SL,TP,"",magicnumber,0,Red);
if(ticket<0)
{
Print("OrderSend failed with error #",GetLastError());
return(0);
}
if((RSI_0 < SELLsignal) && (RSI_1 >= SELLsignal))
ticket=OrderSend(Symbol(),OP_SELL,lots,Bid,3,SL,TP,"",magicnumber,0,Red);
if(ticket<0)
{
Print("OrderSend failed with error #",GetLastError());
return(0);
}