You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
@Jugurtha82, here's another version with selectable cross or proximity.
@Conor Mcnamara, Momentum is omitted as it is not in the OP's requirements.
@Conor Mcnamara, Momentum is omitted as it is not in the OP's requirements.
the thing is though that moving averages by themselves can never confirm a direction of price movement (or do a bad job of it), so without momentum there will be a lot of repainted arrows
the thing is though that moving averages by themselves can never confirm a direction of price movement (or do a bad job of it), so without momentum there will be a lot of repainted arrows
my original indicator was more so about crossing the price (with a point filter for confirmation)
If the criteria is not about crossing the price:
1. Find when the price is very close to the moving average (not crossing)
2. Examine the momentum to confirm a divergence from the moving average
I hate to say go to freelance, but hopefully you can understand code that was given and modify things (iMA, and iMomentum)
the momentum value provided by iMomentum is always normalized around 100, that's why you use it that way
- the momentum divergence will never be true at the same time that the price is close to/touching the moving average, so you have to create a global variable for state tracking and set a flag to true when the price is close to the MA...and then when that is true, you wait for the momentum divergence to be true.
Here you go, bro. I made the MA state tracking global an int that resets to 0 (neutral) upon Momentum leaving trading conditions.
Loads without issue. Tested some inputs without issue. But basically, untested.
Here you go, bro. I made the MA state tracking global an int that resets to 0 (neutral) upon Momentum leaving trading conditions.
Loads without issue. Tested some inputs without issue. But basically, untested.
Found a misplaced curly bracket the code.
Fixed in v2 (attached).
I figure that the CodeBase is the quintessential place for free code. You seem to have disclosed a dual indicator strategy here, so nice back at you.
With inputs Cross on, Mom on, and your original numerical settings used, the indicator appears to be highly selective at catching price runs: