OK, I'll explain everything in order, trying to be specific and not to overflow...
It's based on a trend trading strategy called "Puria Method". It is based on crossing three moving averages and MACD bar opening. Two slow with periods (75) and (85), Linear Weighted method applied to Low. A fast average with a period (5), Exponential method, apply to Close. MACD indicator with the parameters 15/26/1. Entry point is formed by crossing two slow moving averages and MACD bar opening into the relevant zone with the fast one ( fast and MACD bar should be in the same zone):
BUY Signal - MA(5) crossed and is above both MA(75) and MA(85) with the MACD bar open in the positive area.
SELL Signal - MA(5) crossed and is below both MA(75) and MA(85), MACD has an open bar in the negative area.
The EA places a fixed profit and stop loss. The size of the profit and stop are set in the initial parameters. Orders are closed only when they reach Take Profit or Stop Loss.
This is what was in the original Puria Expert Advisors. Plus, in the latest version, there is also a trailing stop and option to trade by certain hours. Functions are useful, but I am not really interested in them now.
Now, actually, what additions I have made/want to make:
1. To make a dealopening andcheck for all indicator conditions(crossing a fast (5) of two slow (75) (85) and opening of a MACD bar in the same direction with a fast (5)), was performed only at opening price of a new candle(the first tick of each 30 minute candle). This has already been handled;
Create conditions for "zeroing" of indicators. For example, for a fast moving (5) If it is higher than slow - then it is a signal to buy. If it then goes down and either touches one of them, or is between the slow moving (75) and (85)- then the signal from the fast moving indicator "zeros out" as it were, and will remain in this"zero" position as long as it touches or remains between the slow ones. If, after that, fast one crosses both slow ones to one side(including if it returned to the side it came from before touching the slow ones) - then it will be a signal of this indicator. With MACD the situation is similar- OnlyMACD=0 will be considered as "zeroing"(if on the first candle the MACD, for example, opened with 0.0043, and on the second candle with -0.0010, it means that the MACD on the second candle has "zeroed" and has given a new signal). However, there is a time whenthe fast (5) and the MACD should be kind of "on equal footing" - if (5) doesn't change its position relative to the slow, and the MACD has opened on the previous candle in the wrong zone (no entry), and on the next one - in the same zone as the fast, then all conditions have converged and an entry to the order should occur. Note that all this should be only on the opening prices of the candles - only on this one tick;
And the last, to make theExpert Advisor wait for 4 consecutive candle openings:
1. 1st open price - (5) above (75) and (85) + MACD bar opened above 0 - 1 out of 4 confirmations; 2.The opening price of the 2nd candle - (5) over (75) and (85) + MACD bar opened above 0-2 out of 4 confirmations is; 3. The opening price of the 3rd candle - (5) over (75) and (85) + MACD bar opened above 0-3 out of 4 confirmations is; 4.Opening price of the 4th candle - (5) over (75) and (85) + MACD bar opened above 0-4 out of 4 confirmations yes-Open buy trade on the same candle (4th).
The same situation with orders tosell, only in the other direction indicators should open. And there is an important point - if at, say, any stage from the 1st candle to the 4th,the indicators change their position(for example, on the 3rd opening candle, the MACD bar opens either below 0, or =0) - then everything is reset, because the signals have not passed the test on the opening of the 4th candle in a row.
Somehow, if something is unclear, or there are questions, please ask.
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.
MakarFX, tried it - no change, it only opens on buy, but sell is completely ignored...
What should we add to these conditions?
Explain the logic...
The first one is clear: there is a signal and no orders are opening...
... and then I do not understand under which conditions orders should be opened or closed
What then do you need to add to make the conditions?
Try this
OK, I'll explain everything in order, trying to be specific and not to overflow...
It's based on a trend trading strategy called "Puria Method". It is based on crossing three moving averages and MACD bar opening. Two slow with periods (75) and (85), Linear Weighted method applied to Low. A fast average with a period (5), Exponential method, apply to Close. MACD indicator with the parameters 15/26/1. Entry point is formed by crossing two slow moving averages and MACD bar opening into the relevant zone with the fast one ( fast and MACD bar should be in the same zone):
The EA places a fixed profit and stop loss. The size of the profit and stop are set in the initial parameters. Orders are closed only when they reach Take Profit or Stop Loss.
This is what was in the original Puria Expert Advisors. Plus, in the latest version, there is also a trailing stop and option to trade by certain hours. Functions are useful, but I am not really interested in them now.
Now, actually, what additions I have made/want to make:
1. 1st open price - (5) above (75) and (85) + MACD bar opened above 0 - 1 out of 4 confirmations;
2.The opening price of the 2nd candle - (5) over (75) and (85) + MACD bar opened above 0- 2 out of 4 confirmations is;
3. The opening price of the 3rd candle - (5) over (75) and (85) + MACD bar opened above 0- 3 out of 4 confirmations is;
4.Opening price of the 4th candle - (5) over (75) and (85) + MACD bar opened above 0- 4 out of 4 confirmations yes- Open buy trade on the same candle (4th).
Somehow, if something is unclear, or there are questions, please ask.
OK, I'll explain everything in order, try to be specific and not to overflow...
This is zeroing.
Maybe I don't understand you correctly...
try to make a screenshot
I've attached a screenshot, if you don't understand something, just ask me.
Attached a screenshot, if anything is not clear - just ask
Try this one - will it open in those places?