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
I've amended (LPrice>LLPrice) , should the (HPrice>HHPrice) sign be amended?
Seng,
I'm sorry, The function is now returning 0.0 for downtrend throughout, what is wrong?
Seng,
I'm sorry, The function is now returning 0.0 for downtrend throughout, what is wrong?
Here's the error:
if (LPrice<LLPrice && LLPrice!=0 && InRetracement) { InRetracement = false; LLPrice = 0; double CurrRetracement = iHigh(NULL,0,HighBars[ArrayIdx])-iLow(NULL,0,LowBars[ArrayIdx]); if (CurrRetracement>MaxRetracement || MaxRetracement==0) MaxRetracement = CurrRetracement; ArrayIdx++; }
Should change to HHPrice = 0;
Here's the error:
Should change to HHPrice = 0;
There is still a problem with this function, returns o. Could it be this: if (Direction<0)?
There is still a problem with this function, returns o. Could it be this: if (Direction<0)?
I don't know... I've tested already, should work. Anyway, I've attached my full code with both uptrend and downtrend - see if it differs from yours.
I don't know... I've tested already, should work. Anyway, I've attached my full code with both uptrend and downtrend - see if it differs from yours.
Seng,
Thank you very much it works , l did scratch my head quite a lot on this problem...... One more final question:
If for example I want to to recall the retracement for the past 15 candles, should i leave the -1 on the oninit( or onstart on your code) like below and on my code just use 1? Do I need to use -1 on both?
Seng,
Thank you very much it works , l did scratch my head quite a lot on this problem...... One more final question:
If for example I want to to recall the retracement for the past 15 candles, should i leave the -1 on the oninit( or onstart on your code) like below and on my code just use 1? Do I need to use -1 on both?
The 1 or -1 here represents the trend direction.
Ok to determine the trend drawdown in 15 bars, in uptrend or downtrend i've used this code further down within ontick:
Is this ok?
Ok to determine the trend drawdown in 15 bars, in uptrend or downtrend i've used this code further down within ontick:
Is this ok?
Yes.