3 Moving Averages
-
Hello everyone, I've been gone for a while, I hope everyone is well and everything is fine.
I need your help.
I'm designing an EA based on a moving average.
Conditions:
1- MA20 will be below MA50
2- MA50 will be below MA100
3-Candle will be below MA20
4-The next candle will cross MA20 up.
5-The candle that opens will be smaller than the previous candle.
15 pips Sell trade will open on 6-next candle.
(3 moving average settings: exponential-low price)I shared my project link where am I going wrong? The EA is not trading as I wrote.
I will be waiting for your help.
https://fxdreema.com/shared/X65volfxc
-
Umarım çözümü bulursunuz da bende nasiplenirim

-
@ladydolares I do not fully understand the strategy. Is the short bear candle pointed out in your screenshot the one supposed to open a sell? If so I don't see the previous candle was crossing down the MA20. Could you please be a bit more specific?
-
I am not an expert but I do not think that you can use candle 0 in the way that you are doing? Example block #4 Candle 0 " Candle total size" candle 0 is the current candle The total size cannot be calculated until the candle is closed. Then it becomes candle 1. Similar thing with block #5 How can the candle 0 open cross above a MA? I think that you have to use "market properties"

-
@dore Candle pips won't match a price level:

I would use candle high for this:

-
ah yes, candle size is in pips!!. he needs to use a price level. Can he use candle 0 candle high? Do we know what the candle 0 high is before it closes? I have had a bunch of problems when using candle 0 & I get very confused. I now use market properties which is the current price & that seems to work better for me
-
@dore Every candle constantly has a high, but as 0 closes it becomes 1. If 1 is used for a cross then as it becomes 1 this is checked, if 0 high is used then the cross is checked before the candle closes.
-
@l-andorrà
Conditions:
1- MA20 will be below MA50
2- MA50 will be below MA100
3-Candle will be below MA20
4-The next candle will cross MA20 up.
5-The candle that opens will be smaller than the previous candle.(condition 4 written at the top of the picture)
Is it clear? -
@dore I tried it,but it doesn't work.
-
help please please help..
-
@ladydolares You can try this:
-
@l-andorrà unfortunately, the ea did not work according to the strategy I stated.
After the candle is below ma 20, any of the other candles to be opened should cross the ma20 up, so if I need to explain in detail1- MA20 will be below MA50
2- MA50 will be below MA100
3-candle below ma20
4-candle cut ma20 diagonally up -----***** this condition may not be met immediately, after a few candles intervene, the candle can cut ma20 diagonally up.Other conditions must continue without any candles in between, respectively.
5-The opened candle will be smaller than the previous candle.The 6-sell trade opens.
*The important thing here is; Condition1-Condition2-Condition3-respectively, candles can intervene, so if the 4th condition is not met, the ea will wait.
If Condition1-condition2-condition3 is still valid after a few candles
If condition4 meets the conditions, the ea will continue to work and will continue as -condition5-condition6.
To explain with pictures;


-
@ladydolares Then you need a more complex structure. You need a variable (a boolen one, for example) used to identify when condition 3 happened. That will change the variable from false to true. Then you can use a standard 'condition' block requiring that condition to be true before all other conditions are checked. And don't forget to reinitialize it when necessary. I hope this helps.
-
@l-andorrà Thank you again for your help. I could not do this as a project. I am aware that I took up your valuable time and I am sorry about it, but could you please help me as a project?
-
Hi ..... you will need to count the candles till your condition are met.. This is a code made by Jstap in area 20 to do this counting. Maybe it will work for you here:::::
https://fxdreema.com/shared/YLM9C92Zb -
@alphaomega That is certainly a good beginning. Additionally you can use the searcj tool on the forums to find MA crossing threads from the past. There are many of them with useful tips.