PureBytes Links
Trading Reference Links
|
Sorry, I guess my question was not very clear.
Let me try again.
After I get two up days in a row I want the plot to stay at +1 until
I get two down days in a row, then I want the plot to stay at -1
until I get two up days in a row, then I want to plot ot stay at +1
again until I get two down days in a row.....and so on.
Thanx,
Phil
--- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxxx>
wrote:
> Phil,
>
> does this help.
>
> Plot(IIf(O5updn > -1,1,-1) ,"o5updn",colorRed,styleLine);
>
>
>
> Anthony
>
> ----- Original Message -----
> From: "Phil" <KDSnyder96@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Sunday, March 14, 2004 7:57 PM
> Subject: [amibroker] Some Help Please
>
>
> > For those old pro's please bear with what is probably an easy
> > question from a first timer.
> >
> > Here is the code I am working with (simple Full Stoch two days in
> > the up direction creates a "Buy" signal and the convers for
a "Sell"
> > signal:
> >
> > O5Pds1 = Optimize("O5pds1", 16, 5, 20, 1);
> > O5Pds2 = Optimize("O5pds2", 5, 2, 10, 1);
> > O5Pds3 = Optimize("O5pds3", 8, 2, 10, 1);
> >
> > pds = O5Pds1; /*Periods */
> > slw = O5Pds2; /*Slowing for Full Stoch%K*/
> > slwd = O5Pds3; /*Slowing for Full Stoch%D*/
> >
> > FSK = 100*(C-LLV(L,pds))/(HHV(H,pds)-LLV(L,pds)); // FASTSTOCHK
> > FLSK = MA( FSK, slw ); // FULLSTOCHK
> > FLSD = MA( FLSK, slwd ); // FULLSTOCHD
> >
> > His=FLSK;
> >
> > O5Up = IIf(Ref(His,-3)>=Ref(His,-2) AND Ref(His,-2)<=Ref(His,-1)
AND
> > Ref(His,-1)<His, 1,0);
> > O5Dn = IIf(Ref(His,-3)<=Ref(His,-2) AND Ref(His,-2)>=Ref(His,-1)
AND
> > Ref(His,-1)>His,-1,0);
> >
> > O5UpDn = O5Up + O5Dn
> >
> > Buy = O5Up > 0;
> > Sell = O5Dn < 0;
> > Short = Sell;
> > Cover = Buy;
> >
> > What I want to do is to be able to plot O5UpDn. But!
> >
> > The problem I have now is I get a spike to "1" when I have two
> > updays in a row on the Full Stocastic, then the value goes
to "0" as
> > soon as there are not two up days in a row.
> >
> > Ditto on the converse with two down days in a row.
> >
> > So if:
> >
> > Day 1 is up on Full Sto, then O5Up = 0
> > Day 2 is up on Full Sto, then O5Up = 1
> > Day 3 is up on Full Sto, then O5Up = 1
> > Day 4 is down on Full Sto, then O5Up = 0
> > Day 5 is up on Full Sto, then O5Up = 0
> > Day 6 is up on Full Sto, then O5Up = 1
> >
> > How do I hold the "1" for a plot?
> >
> >
> > Thanx,
> >
> > Phil
> >
> >
> >
> > Send BUG REPORTS to bugs@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > --------------------------------------------
> > Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.614 / Virus Database: 393 - Release Date: 3/5/2004
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
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/
|