moving average crossover method.
-
what would i put in my trading moving average blocks to that the trade, buy or sell, only happens if it crosses over the other moving average like a lot. Im trying to eliminate false signals.. sometimes it barely crosses over and comes back.. I don't want that trade to go through... How do i do that in a moving average block ? Please help..
-
The question is impossible to answer unless you define exactly what you mean by "a lot". Do you mean the one moving average stays above the other for a defined number of candles, or it moves such that it is a defined number of pips, or other value, above the second moving average?
When creating an EA I always find it useful to write out exactly what I expect it to do before I start the project. This helps me define exactly what blocks to use and how to use them. If you can't define exactly the action the EA should take it will be difficult, if not impossible, to write the code or create using fxDreema. -
@cpbonzo said in moving average crossover method.:
yes, I mean the one moving average stays above the other for a defined number of candles, or pips. yes.. How would i block that?
-
The condition block has an option to adjust the value on each side of the condition. So, for example, you could have your faster MA on the left and the condition is that this is greater than the slower moving average on the right. The block works by comparing the value of the left side to the value of the right side.
If in the adjust box for the right side you put +0.2 then 0.2 will be added to whatever the value is of the moving average at the specified point in time. If you put +2pips in the box it will add twice the pip value (which will depend on the instrument) to the value of the MA. For example, if the slower MA value at the previous candle time was 0.9031 and you have +2pips in the adjust box the value of that side of the condition becomes 0.9033. Therefore if you set the candle ID for both sides to 1 the condition block will pass if the value of the faster MA at the previous candle completion is greater than 0.9033 which is the value of the slower MA plus two pips.
-
@cpbonzo can you please please show an example? you just lost me in that explanation . I kind of understand.. But it was so literal and amazing.. But I go lost
-
@mrfilthy11 I see you have asked similar questions on other posts and that @ambrogio has already provided an example of how to adjust the value here: https://fxdreema.com/forum/topic/10174/moving-average-crossover
-
@cpbonzo but all that did was start the trade candles later.. is that what's supposed to happen?
-
Yes, you asked how to ensure the price had crossed the moving average a lot and in most circumstances that means the condition is met by a later candle than if you just wanted the moment the moving average was actually crossed.