PureBytes Links
Trading Reference Links
|
Hi,
Dimitri is right, however we can use 'peak()' or 'trough()' functions
with realistic results but with some additional conditions. Here's
example of buy signal of trend following system:
/* Growing Bottoms */
chg = 3;
Czynnik = Close;
/* You may use what you want: 'rsi()', 'ma(C,2)' etc. */
Dno1 = Trough(Czynnik, chg, 1); /* last trough */
Dno2 = Trough(Czynnik, chg, 2); /* previous trough */
Buy =
Dno1 > Dno2 AND /* last trough is higher than the previous */
/* additional conditions to make signals realistic */
Czynnik >= Dno1 + (chg/100 * Dno1) AND
/* Today price = last trough + chg% of last trough */
Ref(Czynnik, -1) <= Dno1 + (chg/100 * Dno1);
/* For prevent repeated buy signals */
For sell signal usely I use Chandelier exit and the contrary of buy
signal.
Dimitris Tsokakis wrote:
> As you see, A or B or C are not YET peaks.
> May be after some days of fluctuation you will notice
> that C was a peak, but the "decision" will come with a
> delay.
|