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

[amibroker] Re: The Watered Down Semi-Interesting System



PureBytes Links

Trading Reference Links

Sid,

With regards to the Equity Line indicator and a syntax error that you 
are getting, I'd be more then happy to help but I and lots of other 
folks have been running this code without incident since it was first 
posted in the files section which was well before the most current 
incarnation which was posted in mid January.

Fred

--- In amibroker@xxxxxxxxxxxxxxx, Sidney Kaiser <s9kaiser@xxxx> wrote:
> Fred, I think all of us got that same error.... Buy, sell, short 
and cover 
> are all present in the AA system test. there is some sort of error 
in here 
> somewhere.  It is also hard to save the indicator because of that 
same 
> error.  Also I do find it necessary to add the extra /* to get an 
equity 
> plot from the AA button.  From the indicator edit window using the 
apply 
> button gives an immediate error at the usual spot.
> 
> BTW if anyone is getting about 622% gain instead of 6108% check 
settings to 
> see if you have the "allow same bar exit"  checked in AA settings.  
Also 
> you can't have fractional shares of QQQ.
> 
> Sid
> 
> At 11:15 PM 02/20/2003 -0500, you wrote:
> 
> >Fred,
> >
> >When I pasted your code into the equity indicator I'm getting a 
very 
> >strange error message on this line:
> >
> >
> >FirstBar = ValueWhen(ExRem(Buy OR Short, 0), Cum(1));
> >
> >Its pointing to the OR and saying "Unknown identifier at line 22, 
column 
> >33:"   I've tried re-typing that part by hand thinking that there 
was 
> >phantom character in it but that didn't work and I can't figure 
out what 
> >the heck is going on.. any idea?
> >
> >
> >
> >d
> >-----Original Message-----
> >From: Fred <fctonetti@xxxx> [mailto:fctonetti@x...]
> >Sent: Thursday, February 20, 2003 10:39 PM
> >To: amibroker@xxxxxxxxxxxxxxx
> >Subject: [amibroker] Re: The Watered Down Semi-Interesting System
> >
> >Sid,
> >
> >That should not be necessary because that's the first thing in the
> >Equity Line indicator (See Below).  The code below also includes 
the
> >later thought of ANN%
> >
> >/* */
> >//--equity-plot-- do not remove this line
> >
> >MaxGraph    = 10;
> >GraphZOrder =  1;
> >GraphXSpace = 20;
> >GraphYSpace = 10;
> >
> >BIR      = IIf(Status("BarInRange") > 0, 1, 0);
> >
> >BarEq    = Equity(1);
> >CurEq    = Equity();
> >MaxEq    = Highest(CurEq);
> >FlatEq   = IIf(BIR, BarsSince(MaxEq > Ref(MaxEq,-1)),0);
> >MaxFlat  = Highest(FlatEq);
> >LMaxFlat = LastValue(MaxFlat) * (1 + GraphYSpace / 100);
> >LogEq    = log10(CurEq);
> >
> >CurDD    = IIf(BIR, 100 * (MaxEq - CurEq) / MaxEq, 0);
> >MaxDD    = Highest(CurDD);
> >LMaxDD   = LastValue(MaxDD) * (1 + GraphYSpace / 100);
> >CumDD    = Cum(CurDD);
> >
> >FirstBar = ValueWhen(ExRem(Buy OR Short, 0), Cum(1));
> >LastBar  = LastValue(ValueWhen(Status("LastBarInRange") > 0, Cum
(1)));
> >TotBars  = LastValue(Cum(1));
> >BarNo    = ValueWhen(BIR > 0, Cum(1) - FirstBar + 1);
> >NoBars   = LastValue(BarNo);
> >
> >Dates    = DateNum();
> >Days     = ValueWhen(BIR > 0, IIf(Dates != Ref(Dates,-1), 1, 0));
> >TotDays  = Cum(Days);
> >BPD      = BarNo / TotDays;
> >
> >CAR      = ValueWhen(BIR > 0, 100 * ((CurEq / Ref(CurEq, -(BarNo -
> >1))) ^ (1 / (BarNo / BPD / 252)) -1));
> >Ann      = ValueWhen(BIR > 0, 100 * ((CurEq / Ref(CurEq, -(252 *
> >BPD)) - 1)));
> >MAR      = ValueWhen(BIR > 0, CAR / MaxDD);
> >UI       = ValueWhen(BIR > 0, sqrt(CumDD / BarNo));
> >UPI      = (CAR - 5.4) / UI;
> >TPI      = UPI / MaxDD;
> >
> >bb0      = LastValue(LinRegIntercept(Ref(LogEq, -(TotBars -
> >LastBar)), NoBars));
> >mm       = LastValue(LinRegSlope(Ref(LogEq, -(TotBars - LastBar)),
> >NoBars));
> >yy       = mm * BarNo + bb0;
> >
> >BarsCum  = ValueWhen(BIR > 0, Cum(BarNo));
> >AvgBar   = LastValue(BarsCum) / NoBars;
> >SRDevSQ  = ValueWhen(BIR > 0, sqrt(Cum((BarNo - AvgBar) ^ 2)));
> >ErrEq    = LastValue(StdErr(Ref(logEq, -(TotBars - LastBar)),
> >NoBars));
> >KRatio   = ValueWhen(BIR > 0, mm * SRDevSQ / ErrEq / sqrt(NoBars));
> >
> >TradeEq  = IIf(Sell, (BarEq - ValueWhen(Buy, BarEq)) / ValueWhen
(Buy,
> >BarEq), 0) +
> >            IIf(Cover, (BarEq - ValueWhen(Short, BarEq)) / 
ValueWhen
> >(Short, BarEq), 0);
> >PosEq    = Cum(IIf(TradeEq > 0, TradeEq, 0));
> >NegEq    = Cum(IIf(TradeEq < 0, TradeEq, 0));
> >PosTrade = Cum(TradeEq > 0);
> >NegTrade = Cum(TradeEq < 0);
> >AvgPos   = PosEq / PosTrade;
> >AvgNeg   = NegEq / NegTrade;
> >PosPct   = PosTrade / (PosTrade + NegTrade);
> >Expect   = (1 + AvgPos / abs(AvgNeg)) * PosPct - 1;
> >
> >Plot(IIf(BarNo > 0, CAR,    -1e10), "CAR%",  colorBrightGreen,
> >styleNoLine | styleNoLabel);
> >Plot(IIf(BarNo > 0, Ann,    -1e10), "Ann%",  colorBrightGreen,
> >styleNoLine | styleNoLabel);
> >
> >Plot(IIf(BarNo > 0, -CurDD, -1e10), "CDD%",  colorRed,
> >styleOwnScale | styleHistogram, -LMaxDD, LMaxDD);
> >Plot(IIf(BarNo > 0, -MaxDD, -1e10), "MDD%",  colorDarkRed,
> >styleOwnScale,                  -LMaxDD, LMaxDD);
> >
> >Plot(IIf(BarNo > 0, MAR,    -1e10), "MAR",   colorBrightGreen,
> >styleNoLine | styleNoLabel);
> >
> >Plot(IIf(BarNo > 0, UI,     -1e10), "UI",    colorYellow,
> >styleNoLine | styleNoLabel);
> >//Plot(IIf(BarNo > 0, UPI,    -1e10), "UPI",   colorGreen,
> >styleNoLine | styleNoLabel);
> >//Plot(IIf(BarNo > 0, TPI,    -1e10), "TPI",   colorGreen,
> >styleNoLine);
> >//Plot(IIf(BarNo > 0, Expect, -1e10), "Exp",   colorGreen,
> >styleNoLine);
> >//Plot(IIf(BarNo > 0, KRatio, -1e10), "KRatio",colorGreen,
> >styleNoLine | styleNoLabel);
> >
> >Plot(IIf(BarNo > 0, FlatEq, -1e10), "CF",    colorYellow,
> >styleOwnScale | styleHistogram, -LMaxFlat, LMaxFlat);
> >Plot(IIf(BarNo > 0, MaxFlat,-1e10), "MF",    colorDarkYellow,
> >styleOwnScale,                  -LMaxFlat, LMaxFlat);
> >
> >Plot(IIf(BarNo > 0, yy,     -1e10), "LinReg",colorBlue,
> >styleThick | styleOwnScale | styleNoLabel);
> >
> >
> >
> >--- In amibroker@xxxxxxxxxxxxxxx, Sidney Kaiser <s9kaiser@xxxx> 
wrote:
> > > At 08:04 PM 02/20/2003 -0500, you wrote:
> > >
> > > >Fred,
> > > >
> > > >I get an error in the "FirstBar = ValueWhen(ExRem(Buy OR Short,
> >0),
> > > >Cum(1));" at the OR location....
> > > >
> > > >Can you provide assistance
> > >
> > > Not Fred, but maybe I can help.  That is the error message I got
> >when the
> > > AA system results were not communicating with the indicator
> >module.  Check
> > > to see that you have   /*   at the bottom of the AA system 
script.
> >That
> > > seems to enable the link between the tester and the indicator 
code.
> > >
> > > Sid
> > >
> > >
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system 
> > (<http://www.grisoft.com).>http://www.grisoft.com).
> > > Version: 6.0.455 / Virus Database: 255 - Release Date: 
02/13/2003
> >
> >
> >
> >Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> >(Web page: 
> ><http://groups.yahoo.com/group/amiquote/messages/)
>http://groups.yahoo.com/group/amiquote/messages/)
> >
> >Check group FAQ at: 
> 
><http://groups.yahoo.com/group/amibroker/files/groupfaq.html>http://g
roups.yahoo.com/group/amibroker/files/groupfaq.html 
> >
> >
> >Your use of Yahoo! Groups is subject to the 
> ><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
> >
> >
> >Yahoo! Groups Sponsor
> >ADVERTISEMENT
> >
> >Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> >(Web page: 
> ><http://groups.yahoo.com/group/amiquote/messages/)
>http://groups.yahoo.com/group/amiquote/messages/)
> >
> >Check group FAQ at: 
> 
><http://groups.yahoo.com/group/amibroker/files/groupfaq.html>http://g
roups.yahoo.com/group/amibroker/files/groupfaq.html 
> >
> >
> >Your use of Yahoo! Groups is subject to the 
> ><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
> >---
> >Incoming mail is certified Virus Free.
> >Checked by AVG anti-virus system (http://www.grisoft.com).
> >Version: 6.0.455 / Virus Database: 255 - Release Date: 02/13/2003
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.455 / Virus Database: 255 - Release Date: 02/13/2003


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 

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