If anyone wants it, here's the ATR MA indicator. It's a very simple custom I made, of the ATR plus two of its moving averages. The histogram shows the difference between the first and second MAs. I find it very useful for day trading, provides an easy way of detecting when the market has begun to accelerate...
qjol, thanks for the suggestion, but that didn't work either =\
If you wanted to code the condition "buy when price crosses X line and sell when it crosses Y", how would you do it? I mean... this seems like an extremely simple thing to put into MQL4, it's strange that I'm having such a hard time with it.
But now the EA isn't modifying the orders with SL/TP correctly, so all it's doing is placing one order and and then closing it when the testing period is finished.
Can't things just work properly, the first time around?! =(
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.
oops. i haven't noticed that u made a change and replacement in the code above i remembered SwingValue[0]
try
i'm not sure & didn't testedzzuegg don't bother to backtest it because you don't have the file "ATR MA"
If anyone wants it, here's the ATR MA indicator. It's a very simple custom I made, of the ATR plus two of its moving averages. The histogram shows the difference between the first and second MAs. I find it very useful for day trading, provides an easy way of detecting when the market has begun to accelerate...
qjol, thanks for the suggestion, but that didn't work either =\
If you wanted to code the condition "buy when price crosses X line and sell when it crosses Y", how would you do it? I mean... this seems like an extremely simple thing to put into MQL4, it's strange that I'm having such a hard time with it.
i think
not tested
After staring at the screen for hours, I adopted a convoluted work-around, which seems to have put a band-aid on the problem.
Instead of using Bid and Ask, I use the two 1-period SMAs, applied to High/Low; when they cross the swing level, Buy/Sell signals are triggered:
But now the EA isn't modifying the orders with SL/TP correctly, so all it's doing is placing one order and and then closing it when the testing period is finished.
Can't things just work properly, the first time around?! =(
Scroll down to the next section. I have an ECN broker so I can't pass SL/TP with the order.
^-- The order modifying section from one of ubzen's EAs =)... not technically OrderModify()