[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] ApplyStop question



PureBytes Links

Trading Reference Links

I canšt solve your problem exactly, but I can tell you why youšre getting
erroneous results. 

If OK is True, you are setting, Buy = ApplyStop...This is the bogus.

Buy = your Buy signal.

ApplyStop is a separate function that must have it's own line.
X = ApplyStop makes no sense.

Also, IIF statements always executes BOTH sides of the IIF so ApplyStop is
always executed regardless of the condition of OK.

I think you just need your ApplyStop without any conditions since you have
your point value as the SAR which varies with market conditions. Remember
that Amibroker is an Array processing language. So every day of the Array
SAR(14) has it's own value.

Sorry for being a bit vague, but just try it.

ApplyStop(2,2,SAR(14),1)
Buy = Cond1
Sell = Cond2
-- 
Terry


From: "zimm630" <zim630@xxxxxxxx>
Reply-To: amibroker@xxxxxxxxxxxxxxx
Date: Mon, 18 Oct 2004 13:31:26 -0000
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] ApplyStop question


I am attempting to back-test situations where when the market or
stock is trending to trade the Parabolic SAR from that side only,
i.e. long trades only in uptrending markets.  To test I used simply
PDI>MDI as follows:
OK=IIf(PDI(14)>MDI(14),1,0);
Buy=IIf(OK,Buy=ApplyStop(2,2,SAR(14),1),0);
Sell=ApplyStop(2,2,SAR(14),1);
I have also tried buying Cross SAR,H and selling Cross SAR instead of
applystop. I am receiving totally erroneous results, it often seems
to buy one day and sell the next regardless of conditions.  I know I
am missing something perhaps very simple.  Any ideas will be greatly
appreciated.
Thanks
Bill





Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html


Yahoo! Groups Sponsor
 
 ADVERTISEMENT
 <http://us.ard.yahoo.com/SIG=129o6jib3/M=315388.5497957.6576270.3001176/D=g
roups/S=1705632198:HM/EXP=1098192694/A=2372354/R=0/SIG=12id813k2/*https://ww
w.orchardbank.com/hcs/hcsapplication?pf=PLApply&media=EMYHNL40F21004SS>


Yahoo! Groups Links
* To visit your group on the web, go to:
* http://groups.yahoo.com/group/amibroker/
*  
* To unsubscribe from this group, send an email to:
* amibroker-unsubscribe@xxxxxxxxxxxxxxx
<mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
*  
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/