PureBytes Links
Trading Reference Links
|
Hi there,
> is as follow. Buy tomo if price crosses today's high when RSI has falls
> below 30 & turns up. Also where should I input the stop code? In the
long
You can save a lot of trouble by using the 'Cross' function as it will
remove a lot of the 'Ref's you use. Also, I suggest you try to
rephrase all to have *today* as the point of reference, so something like
"Buy if price cross above yesterday's high AND RSI crosses above 30"
Since the RSI will only cross above 30 every once in a while, this
potentially will not generate a lot of signals. But, if we just test
on if the RSI is above 30, we will also get signals when it is say
falling from 70 downwards which we wish to ignore. So let us make the
second condition more general
"Buy if price cross above yesterday's high AND RSI has recently
crossed above 30 but not yet reached 70"
Please check this - if it is what you want, the OTC code below should
help. When you 'read' this code, keep in mind that * means AND.
TickSize := 0.01;
EnterLong := ( C >= Ref( H, -1 ) + TickSize ) * ( RSI(14) > 30 ) * (
RSI(14) < 70 );
Now, this code will work whenever the RSI is between 30 and 70, which
is half of what we want. We also want it to only enter long if the
RSI is in this range AND has moved above 30 more recently than it fell
below 70, so change it to
TickSize := 0.01;
EnterLong := ( C >= Ref( H, -1 ) + TickSize ) * ( RSI(14) > 30 ) * (
RSI(14) < 70 ) * ( BarsSince(RSI(14)>70) > BarsSince(RSI(14)<30) );
Please test this and then we can work on the rest of the stuff if this
is a step in the right direction.
Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://www.ferra4models.com
http://fun.ferra4models.com
--- In equismetastock@xxxxxxxxxxxxxxx, "tan ming"
<reminiscenostalgia@xxxx> wrote:
>
> Hi MG Ferreira,
>
> I had input the code into the system tester but fail to generate buy
signals
> only when today price cross yestersday's high. The buy signal in
desciption
> is as follow. Buy tomo if price crosses today's high when RSI has falls
> below 30 & turns up. Also where should I input the stop code? In the
long
> window as well? Tks for your advice.
>
> YestPrice :=ValueWhen(1,Ref(RSI(C,14) > Ref(RSI(C,14),-1) AND
> Ref(RSI(C,14),-1) < Ref(Fml("Cycles10"),-2) AND RSI(C,14) < 30,H);
> TickSize:= 0.01;
> EnterLong:=C >= Ref( H, -1 ) + TickSize;
>
> StopLevel := ( EnterLong > 0 ) * ( Low - TickSize );
> ExitLong := TodaysPrice <= StopLevel;
>
> Regards.
>
> _________________________________________________________________
> Get your mobile ringtones, operator logos and picture messages from MSN
> Mobile http://msn.smsfactory.no/
------------------------ Yahoo! Groups Sponsor --------------------~-->
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|