![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Thanks!
Dave
Does this mean a static variable holds the last value assigned to it even though it is not global?
Yes, but it can be used inside of that function only. You can have global variables with the same name as the static variable (I'm 99% sure), but it's good use not too, so you don't mix things up.
The other questions someone else might want to answer as I'm not sure.
Limit orders per bar
Hi I have a quick question. Im trying to code an EA where I will only be able to open one trade per bar. So when I use the 1H timeframe I can only open one order. I tried to add this line to limit the amount of orders, but it does not work.
TimeCurrent()-OrderCloseTime()>60*60
Thanks!
How to change alert into trading EA
Hi Guys,
How do you change an alert indicator into a trading EA?
I've tried changing the command Alert(Symbol()+" "+Period()+" XO Long ",Bid); into OrderSend(Symbol(),OP_BUY,0.01,Ask,3,20,20,"XO-CCI",1,0,Blue); at the start I chose menu to make EA, then content of my alert indicator, i copied to this EA, then I changed the command alert to trading command as above, then i compiled. But the compiled EA is not making any trade after i tried it on 1M chart for a day.
Please help.
Anyone can help? Why got false result from backtest ?
Hi CoderGuru,
I have problem from back test at MT4, i want to have reverse signal, while the signal appears,
my code is :
-------------------
Print("Signal Before Check TradeStyle(",TradeStyle,")");
if (Signal == -1) { StrSignal = "ENTRY-SELL"; }
if (Signal == 1) { StrSignal = "ENTRY-BUY"; }
Print("Signal B4 Check TradeStyle : ",StrSignal);
if (TradeStyle == 2) { Signal = -1*Signal; } // THIS IS FOR REVERSE PURPOSE
Print("Signal After Check TradeStyle(",TradeStyle,")");
if (Signal == -1) { StrSignal = "ENTRY-SELL"; }
if (Signal == 1) { StrSignal = "ENTRY-BUY"; }
Print("Signal After Check TradeStyle : ",StrSignal);
--------------------
The TRUE result for TradeStyle = 1 ( value 1 mean Trend Follower ) is :
--------------------
08:08 EURJPY,M1: Signal Before Check TradeStyle(1)
08:08 EURJPY,M1: Signal Before Check TradeStyle : ENTRY-BUY
08:08 EURJPY,M1: Signal After Check TradeStyle(1)
08:08 EURJPY,M1: Signal After Check TradeStyle : ENTRY-BUY
=> THIS RESULT IS RIGHT / TRUE ,
=> TREND RIDER STYLE DIDN'T CHANGE SIGNAL, SO THE RESULT BEFORE AND AFTER CHECK MUST SAME
=> Signal Before Check ENTRY-BUY
=> Signal After check ENTRY-BUY
--------------------
I use same date data and i show the time for let know, that is the same source data, but RESULT IS WRONG !
Below is FALSE result for TradeStyle = 2 ( value 2 mean COUNTER / REVERSE Trend ) is :
--------------------
08:08 EURJPY,M1: Signal Before Check TradeStyle(2)
08:08 EURJPY,M1: Signal Before Check TradeStyle : ENTRY-BUY
08:08 EURJPY,M1: Signal After Check TradeStyle(2)
08:08 EURJPY,M1: Signal After Check TradeStyle : ENTRY-BUY
=> THIS RESULT IS WRONG / FALSE,
=> COUNTER TREND STYLE MUST REVERSE SIGNAL, SIGNAL BEFORE CHECK AND AFTER CHECK MUST REVERSE
=> Signal Before Check ENTRY-BUY
=> Signal After Check ENTRY-BUY => Should ENTRY-SELL
Anyone can help, thanks in advanced
I've get help from mql4 and my problem dosen't exist now!!![](https://c.mql5.com/forextsd/smiles/wink.png)
Stair-Step Buy Entry Code Problem
If I have a Custom Indicator Statement such as: x=iCCI(Null,7,0,0,0); How do I get the value of x, 1 bar back????
If I code this as x=iCCI(Null,7,0,0,1); I get a value of one stair-step back, not one bar back value of the CCI??
Please help me!!!!!!!!!!!!!!!!!!
Dave![](https://c.mql5.com/forextsd/smiles/frown.png)
Code Problem - Please Help!!
If I have a Custom Indicator Statement such as: x=iCCI(Null,7,0,0,0); How do I get the value of x, 1 bar back????
If I code this as x=iCCI(Null,7,0,0,1); I get a value of one stair-step back, not one bar back value of the CCI??
Please help me!!!!!!!!!!!!!!!!!!
Dave
Price
i AM LOOKING FOR an MT4 INDICATOR THAT SHOWS THE PRICE ON THE CHART IN BIG FONT......i HAVE TROUBLE SEEING THE ONES ON THE SIDE![](https://c.mql5.com/forextsd/smiles/nerd.png)
i AM LOOKING FOR an MT4 INDICATOR THAT SHOWS THE PRICE ON THE CHART IN BIG FONT......i HAVE TROUBLE SEEING THE ONES ON THE SIDE
Here it is attached.
Dave