If(UseRsi)=false the existing EA wont open any trades but he should
and when if(UseRsi)=true the EA works normal and the rsi filter does nothing.
If UseRsi is false then BuyRSI and SellRSI are still at their default values . . . it also looks like you have one too many braces . .
externbool UseRSI=true;
externint RSIperiod=14;
externdouble RSIBuyPoint=50;
externdouble RSISellPoint=70;
bool BuyRSI,SellRSI;
int start()
{
if (UseRSI)
{
double RSI = iRSI(NULL,0,RSIperiod,PRICE_OPEN,0);
if (RSI > RSIBuyPoint)
BuyRSI=false;
else
BuyRSI=true;
if (RSI < RSISellPoint)
SellRSI=false;
else
SellRSI=true;
}
} // this is the closing brace for the start function// before OrderSend if (BuyRSI) // this is outside of start()if(SellRSI)
return(0);
only if i put rsi=false the rest of the EA wont open any trades.
Please a litle hint. I like to have the rest of the EA working if i put rsi=false.
Thanks
externbool UseRSI=true;
externint RSIperiod=14; //rsi periodexterndouble RSIBuyPoint=51; //allow long entry above or equal RSIBuyPointexterndouble RSISellPoint=49; //allow short entry beneath or equal RSISellPointbool BuyRSIAllowTrading,SellRSIAllowTrading;
{
if (UseRSI)
{
double RSI = iRSI(NULL,0,RSIperiod,PRICE_OPEN,0);
if (RSI<RSIBuyPoint)
BuyRSIAllowTrading=false;
else
BuyRSIAllowTrading=true;
if (RSI>RSISellPoint)
SellRSIAllowTrading=false;
else
SellRSIAllowTrading=true;
}
}
// if(BuyRSIAllowTrading).......put in to buy conditions// if(SellRSIAllowTrading)......put in to sell conditions
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.
So exactly what is your problem ?
Thanks Raptor!
Im trying to implement an Rsi filter that allows me to use per choise, Use RSI=true or false.
Allows long trade when rsi>50 and short when rsi<50
RSI=false it should not turn of the existing EA
Is just an extra filter per choise
Thanks Raptor!
Im trying to implement an Rsi filter that allows me to use per choise, Use RSI=true or false.
Allows long trade when rsi>50 and short when rsi<50
RSI=false it should not turn of the existing EA
Is just an extra filter per choise
Yes I know, but when you run your code what is it not doing that it should or what is it doing that it shouldn't ?
If(UseRsi)=false the existing EA wont open any trades but he should
and when if(UseRsi)=true the EA works normal and the rsi filter does nothing.
If(UseRsi)=false the existing EA wont open any trades but he should
and when if(UseRsi)=true the EA works normal and the rsi filter does nothing.
If UseRsi is false then BuyRSI and SellRSI are still at their default values . . . it also looks like you have one too many braces . .
Thanks to Raptor again i got it working so far.
only if i put rsi=false the rest of the EA wont open any trades.
Please a litle hint. I like to have the rest of the EA working if i put rsi=false.
Thanks
Thanks to Raptor again i got it working so far.
only if i put rsi=false the rest of the EA wont open any trades.
Please a litle hint. I like to have the rest of the EA working if i put rsi=false.
Thanks
Thanks to Raptor again i got it working so far.
only if i put rsi=false the rest of the EA wont open any trades.
Please a litle hint. I like to have the rest of the EA working if i put rsi=false.
You need to show more of your code . . . we can't see how you are using your bools in relation to opening trades . . .
Here are my sell and buy conditions i believe ths change need to be made here.
Thanks for beeing on today.
Here are my sell and buy conditions i believe ths change need to be made here.
Thanks for beeing on today.
Why wouldn't I be here today ?
As I said before . . .
If UseRsi is false then BuyRSI and SellRSI are still at their default values . . .
. . . but you have changed the variable names.
Look at this and understand why it will work . . .
Why wouldn't I be here today ?
As I said before . . .
. . . but you have changed the variable names.
Look at this and understand why it will work . . .
Thank you very much it works now just fine but i do not understand the code line please point me to some text i can read about it.
thanks again.