PureBytes Links
Trading Reference Links
|
Hi Gary,
Try the ref(x,-n) function, which references or 'delays' a time
series x with n periods. So you could do something like calculate
two triggers,
Trigger1 := some stuff
Trigger2 := some stuff, based on Ref(Trigger1,-1)
and use Trigger2. I did not attempt to do it with your code, but
hope you get the idea. The same applies for your entry/exit code. In
stead of using say signal, use Ref(signal,-1) to delay execution
with 1 bar.
Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://www.ferra4models.com
http://fun.ferra4models.com
--- In equismetastock@xxxxxxxxxxxxxxx, "richr4ever"
<richr4ever@xxxx> wrote:
>
> Hello to all:
>
> I have two questions here. One about eliminating the PREV and one
on
> signal delay.
>
> For PREV, I have the below codes:
>
> LE:=Condition A
> SE:=Condition B
> LX:=Condition C
> SX:=Condition D
> Trigger:=If( LE=1, 1, If(SE=1, -1, If((LX AND PREV=1) OR (SX AND
> PREV=-1),0,PREV)));
> LEEntry:=Cross(Trigger,0.5 );
>
> How can I perfect the above codes by removing the PREV function
and
> increase the codes efficiency, and without using any DLL?
>
> And for the signal delay, say the Long Exit's condtion is met on
> current bar. But I want the Long Exit signal set to one bar delay
to
> next bar's open. I am currently using BarsSince() function but I
> wonder if there a better way to code it. I don't want to use the
> System Tester feature for this purpose.
>
> Many thanx in advance!
>
> Gary.
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/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/
|