Hello, I wanted to make a filter so that a given number of buy/sell signals issued by the indicator would be skipped. I tried to implement it with global variables to fix the number of signals received and compare it with a given variable. It works, but in global variables the number of signals is not increasing. What is the error? Or there is a simpler way to implement the idea?
Tell me about the program TakeMySpread to change the spread. It allows you to change the spread on the symbol to test and optimize. Is there a program that changes the level of stop loss or freeze frame? Or how do I do it manually?
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.
extern int Period_MA = 21;
bool Fact_Up = true;
bool Fact_Dn = true;
int start()
{
double MA;
MA=iMA(NULL,0,Period_MA,0,MODE_SMA,PRICE_CLOSE,0);
if (Bid > MA && Fact_Up == true)
{
Fact_Dn = true;
Fact_Up = false;
Alert("Price is above MA(",Period_MA,").");
}
if (Bid < MA && Fact_Dn == true )
{
Fact_Up = true;
Fact_Dn = false;
Alert("Price is below MA(",Period_MA,").");
}
return;
}
Anyway, it's from the textbook, I wanted to practice, but I got a deadlock, after crossing
I want to give it a report once. How do I get it to report on every tick?
help?
The question is not quite rightly posed
The question is not quite right
it only triggers a message once only after the crossing,
How can I get a message after every tick,
so that on every tick there is a message like "price is above the mach" or "price is below the mach"?
Hello, I wanted to make a filter so that a given number of buy/sell signals issued by the indicator would be skipped. I tried to implement it with global variables to fix the number of signals received and compare it with a given variable. It works, but in global variables the number of signals is not increasing. What is the error? Or there is a simpler way to implement the idea?
Can you please tell me....
//-------------- if(SignalBuy>0) { int B; if(SignalBuy==true){ B=1; } else { B=0; } int PropuskSigB=GlobalVariableGet("PropuskSignalaB"); PropuskSignalaB =B+PropuskSigB; GlobalVariableSet(gvp+"PropuskSignalaB",PropuskSignalaB); PropuskSignalaB=GlobalVariableGet("PropuskSignalaB"); Print ("PropuskSignalaB = ",PropuskSignalaB); } //------------- if(SignalSell>0){ int S; if(SignalSell==true){ S=1; } else { S=0; } int PropuskSigS=GlobalVariableGet("PropuskSignalaS"); PropuskSignalaS =S+PropuskSigS; GlobalVariableSet(gvp+"PropuskSignalaS",PropuskSignalaS); PropuskSignalaB=GlobalVariableGet("PropuskSignalaS"); Print ("PropuskSignalaS = ",PropuskSignalaS); } //-------------How do I normalise the lot to one decimal place? eg lot 1.43 or 1.438 to 1.4 or 1.5 ? otherwise it gives error 131 - incorrect lot size?
How do I normalise my lot to one decimal place? e.g. lot 1.43 or 1.438 to 1.4 or 1.5 ? otherwise it gives error 131 - wrong lot size?
Here's a whole lot normalization feature, like in my EA... In the editor, press F1 on NormalizeDouble() - in the Help
...and it's all explained in details...
Thanks. but double lotStep = MarketInfo(Symbol(), MODE_LOTSTEP);
can't we just do double lotStep = 0.1;?
Thank you. And double lotStep = MarketInfo(Symbol(), MODE_LOTSTEP);
can't we just do double lotStep = 0.1;?
Lotstep is usually 0.01 - it depends on both the broker and the account type, read the trading conditions for your account type -
if there is a 0.1 lotstep, then you can... This is an option for any type of account, so you don't have to worry about it...
Man, does anyone know the answer to my question?