"Cross width" Clarification For Indicators
-
Hello all,
as a newbie I create a EA where the triggers for open a trade are :
-check if MA10 cross above MA20
-check if MA10 is above MA20
Same thing for Sell order.
It is fine what I've done or is garbage?Now, 1 thing that I am not understand very well:
How can avoid weak signals who just cross above and below multiple times, which trigger my EA but is not profitable.
I've tried to use ADX,RSI and STO to get a strong signal,but still workaround.
Here is the project:
https://fxdreema.com/shared/xW65Xoqyd -
Hello, can you please provide an example of what increasing width will do? If you set it to 3 instead of 1, does it search for crossovers in the previous 3 bars instead of just the current bar? Or does it search for crossovers only in bar 3 (i.e. three bars ago)? Also, a newbie question but are bars the same as candles?
Thank you.
-
"cross width"? This is very simple one that I have to update, now it just allows you to compare the current candle with candle+cross width. Normally for crossover you want to check candle X with candle X+1. In the block it's actually candle X with candle X+cross width. If cross width is 3, 4, 5... the candles in between are not checked at all, at least at the moment

-
sorry, I'm still not understanding. If cross width is not the number of candles to check going backwards, what unit of measurement is cross width - is it a time value where 3 is units of whatever timeframe you are in? Thanks
-
Cross width is number of candles between both crossover points. To mention again, the candles in between are not used in this type of crossover, but maybe I will do it that way in future. Now it is simple as that:
- Line A crosses Line B below when: A[new bar] < B[new bar] and A[new bar + cross width] > B[new bar + cross width]
- Line A crosses Line B above when: A[new bar] > B[new bar] and A[new bar + cross width] < B[new bar + cross width]
-

so "new bar + cross width" is # of bars going back? See attached screenshot. And just to confirm - I know you said that the candles in between are not check - if crossover happened at candle 1-5, then statement would not be true?......
cross width.png -
Initially there was the normal crossover only, where second condition is added - the opposite one for the previous candle. Then someone asked something about some distance while checking crossover, and I added this option. It's really just shifting the second condition - instead of checking two values on the previous bar, it checks two values on some other bar.
Normal case with cross width = 1, MA5[1] x> MA10[1] selected:
MA5[1] > MA10[1] AND MA5[2] < MA10[2]Detailed, using cross width:
MA5[1] > MA10[1] AND MA5[1+crosswidth] < MA10[1+crosswidth]If crosswidth is for example 100, only candle 1 and 101 will be checked, not candles in between, two checks only. That means that this option is maybe not really useful, but I will probably play with it later. Maybe it will be better if it helps to check if there was crossover in the past "cross width" candles.
-
got it now, thanks

Yes, checking a range of previous candles would be more useful.
just to clarify, the number 1 in candle[1] means current candle - same meaning but different numbering than close[0] where 0 is current candle?
-
Candle 0 is the current one, 1 is the previous... and so on.
-
so when you say "Normal case with cross width = 1, MA5[1] x> MA10[1] selected", that means crossover is happening in previous candle. If I want to detect crossover in current candle, wouldn't it have to be cross width = 0, MA5[0] x> MA10[0] - but there is no option for zero?
-
Condition left operand: MA5[0]
Condition right operand: MA10[2]
cross width: 1 (default)
crossover model: x>conditions checked by this block:
MA5[0]>MA10[2] and MA5[0+crosswidth]<MA10[2+crosswidth]or just...
MA5[0]>MA10[2] and MA5[1]<MA10[3] -
thanks for the additional information. I also reviewed the crossover documention here: http://fxdreema.com/documentation/proje ... er%20works
Using the method you provided, it still looks like the crossover is being detected a bar later than it actually happens (crossover happens in bar 1). I am looking for a way to detect crossover in current bar, which I guess just detects when line A meets line B, i.e. MA20[0] == MA40[0]. I tried setting up an arrow on the chart with this condition but it did not work (it detects first 2 crossovers and then stops):
http://fxdreema.com/shared/uW1Mhf3se Any ideas why? -
Try with visual testing to see what happens really if you prefer. I just checked how crossover works for candle ID = 0 and it seems fine.
And never use == to compare price values. Using this you will always miss something, because the chance to have two values exactly the same at the same time is not very big. Values are not 1, 2 or 3, they are like 1.23456, 1.23457, 1.23459... who can guarantee that 1.23458 will be there?
-
oh, that's a good point. I did try with visual testing but that explains why it was missing most of the crossovers using the == method. Would you be able to attach an example ea showing the crossover at candle id = 0, I tried putting it together but it still shows crossover a bar behind. Thanks

-
-
@paul-5 Your trailing stop is checked between buy and sell launchers. I recommend you to exchange its ID number with block 55. That way it'll be checked after both launchers.
On the other hand, I'm afraid I'm not good at all at giving advice on profitable strategies, sorry

-
@fxdreema : how to check if crossover is occurring in either candle 1 or 2 or 3 or 5 or nth candle . if i put 5 as cross width, then does the updated fxdreema now allow me to check crossover in the previous 5 candles ?
thanks in advance.
-
@goldis No it won't, easiest way is candle cross on 1 pass, if not connect yellow to another condition, if yes pass, if not check 3, etc until all candle numbers are checkd.