![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
Magic Number
This EA needs a Magic Number. Can anyone add it?
This EA needs a Magic Number. Can anyone add it?
There you go. Though I still stick by my previous post. :-)
There you go. Though I still stick by my previous post. :-)
Many thanks! I've been thinking about your previous post quite a bit, so now I'm finally getting down to understanding this code using the MQL online help. What would you recommend for this section of the code?
double diClose0=iClose(NULL,5,0);
double diMA1=iMA(NULL,5,5,0,MODE_SMA,PRICE_OPEN,1);
double diClose2=iClose(NULL,5,0);
double diMA3=iMA(NULL,5,4,0,MODE_SMA,PRICE_OPEN,1);
I'm thinking...
It doesn't work this way, unfortunately.
You have failed to take into consideration the most important point, spread. Once you enter a trade, you need the price to move in your direction for the spread + profit. For a 5 pip profit, that's easily 7-9 (at least, or even more depending on brokerage/currency pair)
There isn't an indicator that can accurately determine market direction on a 1min and 5m tf, to do so would mean the indicator has overcomed randomness, which is a fundamental property of the free market. :-)
That's why scalping EAs generally tend to have a huge stoploss and drawback, because they try to anticipate the rebound or market to swing in their favour in hope that they can earn a small profit out of it by surviving the reverse direction for long enough.
*In most cases, they usually don't, human intervention is usually required to pull that trigger before the SL becomes too large*
It doesn't work this way, unfortunately.
You have failed to take into consideration the most important point, spread. Once you enter a trade, you need the price to move in your direction for the spread + profit. For a 5 pip profit, that's easily 7-9 (at least, or even more depending on brokerage/currency pair)
There isn't an indicator that can accurately determine market direction on a 1min and 5m tf, to do so would mean the indicator has overcomed randomness, which is a fundamental property of the free market. :-)
That's why scalping EAs generally tend to have a huge stoploss and drawback, because they try to anticipate the rebound or market to swing in their favour in hope that they can earn a small profit out of it by surviving the reverse direction for long enough.
*In most cases, they usually don't, human intervention is usually required to pull that trigger before the SL becomes too large*Oh well. I guess we'll have to use it as a semi-automated system. What would it need to trade on ECN brokers? I have an account with thecollectivefx.com, but it won't make a single trade.
Many thanks for the magic number! I hope your 'pending' status changes soon.
Scary
I came across one recently, that you could run fairly safely if you observed a few minor changes to it, firstly run it on 12 or so currencies at once, secondly, only switch your MT4 software on every 8 hours or so, thirdly close all losing trades with 12 pips loss manually and close all trades with 50 pips profits, and your account will grow.
The logic for the trader was rubbish - like this one - (Or would you calmly sit there and watch your account go $500 into the red - before it came back and closed for a $2.00 profit !!!!!!!!!!!! ???) but it tried to buy/sell corectly at least, it just didn't know one important thing - was the price going UP or DOWN when it hit the MAs ? This thread is doing one thing, giving newbies a chance to see some actual EA code. Anyone using this and making a mint ni real money must have added a few things to it, plus a stop loss.
Hi!
Not to pour cold water on anyone but the signals behind this EA is extremely lacking.
After taking a look at the code, its trigger mechanism is apparent,
It makes use of 2 moving averages-
X - SMA on a 5 minute timeframe based on the PRICE_OPEN at previous 5 minute interval, time-shifted 1 period (MA of 6-10 minutes ago)
Y - SMA on a 5 minute timeframe based on the PRICE_OPEN at previous 4 minute interval, time-shifted 1 period (MA of 5-9 minutes ago)
and
Z - The current CLOSE price at a 5 minute timeframe
When Z < X, it performs a BUY order
When Z > Y, it performs a SHORT order
It is apparent that the creator of this EA is expecting the drawback to be huge enough to absorb any loss, and pray for the price to swing back in the alternate direction.
I strongly advise everyone to stay away from this EA for automated trading, even with a 99% success rate, 1 loss is significant enough to wipe out your account.Well, I tried to reverse the Buy/Sell logic, but I'm not a coder.... yet. Can you reverse the logic and save it as escape2reversed.mq4 ? It seems as though the reverse logic would work better with strong up or strong down trends. What do you think?
Well, I tried to reverse the Buy/Sell logic, but I'm not a coder.... yet. Can you reverse the logic and save it as escape2reversed.mq4 ? It seems as though the reverse logic would work better with strong up or strong down trends. What do you think?
totaly thinking the same... could someone try plz? i tried but failed hard :P
Well, I tried to reverse the Buy/Sell logic, but I'm not a coder.... yet. Can you reverse the logic and save it as escape2reversed.mq4 ? It seems as though the reverse logic would work better with strong up or strong down trends. What do you think?
escape2reversed.mq4
As req, attached is a version of escape.mq4 that performs the reverse, BUY when its supposed to HOLD and HOLD when its supposed to BUY when the flag "reverseLogic" is set.
No offense to Bongo but I realised your version didn't incorporate the magic_number that previous posts had asked for.
Cheers!