Think I might have the simplest, yet one of the most profitable scalping strategies, but experiencing problems with the code...
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.
Keith Watford:
Done, sorry.
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.
Hi,
It would help if you also include the files:
#include <Trade\AccountInfo.mqh> #include <Trade\Trade.mqh> #include <Trade\PositionInfo.mqh> #include <Trade\OrderInfo.mqh> #include <Trade\SymbolInfo.mqh>
Since anyone looking at this would have to be certain about what these do as well...
Best wishes,
Steve.
Steve Miller:
Hi,
It would help if you also include the files:
Since anyone looking at this would have to be certain about what these do as well...
Best wishes,
Steve.
they are standard MQL libraries
enevpavel18:
Hello everyone,
int Signal() { double MA[]; ArraySetAsSeries(MA, true); CopyBuffer(maHandle, 0, 0, 5, MA); double HMA[]; ArraySetAsSeries(HMA, true); CopyBuffer(highHandle, 0, 0, 5, HMA); double LMA[]; ArraySetAsSeries(LMA, true); CopyBuffer(lowHandle, 0, 0, 5, LMA); highMA = HMA[1]; lowMA = LMA[1]; // if(iClose(Symbol(), 0, 1) >= HMA[1] && iOpen(Symbol(), 0, 1) < HMA[1] && iClose(Symbol(), 0, 1) > MA[1]) return(1); // if(iClose(Symbol(), 0, 1) <= LMA[1] && iOpen(Symbol(), 0, 1) > LMA[1] && iClose(Symbol(), 0, 1) < MA[1]) return(2); if(iClose(Symbol(), 0, 1) >= HMA[1] && iOpen(Symbol(), 0, 1) < HMA[1] && iLow(Symbol(), 0, 1) > MA[1]) return(1); if(iClose(Symbol(), 0, 1) <= LMA[1] && iOpen(Symbol(), 0, 1) > LMA[1] && iHigh(Symbol(), 0, 1) < MA[1]) return(2); return(0); }
I checked the signal, the requirement "Whole candle above/below the MA" was not being considered only the close, amended lines above with the highlighted change
Documentation on MQL5: Common Functions / GetTickCount64
- www.mql5.com
GetTickCount64 - Common Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Hello everyone,
I'm gonna be completely honest with you. I am new to all that EA coding and turning trading strategies into fully working robots...! :)))
BUT, I have been trading the markets for a few years now, and I think I have found a strategy, that can be very profitable and yet is one of the simplest there is!
Here comes the problem - as I mentioned I am very new to coding. That is why, somebody recommended me going on Fiverr and paying someone to do it for me.
So, that's what I did - I paid ''ahadmurtaza8'' $50 to code the strategy I am talking about.
Long story short, I received the EA but it seems that it doesn't behave as I expected. It doesn't place any trades, I think I managed to make it place a trade or two but when it did, it placed the sl at completely different points than those I had required from the guy to code.. and it kind of looks a bit overcomplicated and with a bunch of unneeded stuff, in my opinion(sorry if I am wrong). Also, when I ran the strategy tester on it, it wasn't profitable at all, even though I have been very profitable with this strategy for months...
However, I was told that here are quite a few experienced traders and developers. So, I will be very happy if some of you can suggest some changes to the code so that it gets to do what it is really supposed to. :)
Here is the strategy:
Strategy will be used on M15 chart.
What is needed:
- 34 EMA(high)
- 34 EMA(low)
- 200 SMA(open)
1. When a bearish candle opens above and closes below the 34 EMA(low) and the whole candle is below the 200 SMA
——> SELL (right after close of the candle that I am talking about above)
SL: 10 pips above the 34 EMA(high)
TP: 1.8R
And SL should move to break-even right after market has moved 1/10 of the distance from SL to Order, in my direction.
2. When a bullish candle opens below and closes above the 34 EMA(high) and the whole candle is above the 200 SMA
——> BUY (right after close of the candle that I am talking about above)
SL: 10 pips below the 34 EMA(low)
TP: 1.8R
SL moved to break even as described above.
And here is the source code I was provided with:
Thanks everyone so much, even if you have just read to that point.. :)))
Have a great one!