PureBytes Links
Trading Reference Links
|
<FONT face=Arial color=#0000ff
size=2>Phsst...
<FONT face=Arial color=#0000ff
size=2>
Aren't
you completely overwritting CoverPrice when you say:
<FONT face=Arial color=#0000ff
size=2>
CoverPrice =
x;
<BLOCKQUOTE
>
<FONT face="Times New Roman"
size=2>-----Original Message-----From: Phsst
[mailto:phsst@xxxxxxxxx]Sent: Thursday, August 07, 2003 2:19
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] MIN
function not workingIn a SHORT backtest I want to
make my own assignments to theCoverPrice array... then use the CoverPrice
as the 'trailing buy stop'price that I use to stop out a position.
I NEVER want the CoverPrice to INCREASE.I ALWAYS want the
CoverPrice to either REMAIN UNCHANGED OR DECREASEwith each new
bar.I've tried many gyrations of AFL code to accomplish this and
havespent more hours on it than I care to admit to, but I have narrowed
myproblem down to the failure of the MIN function to return the
lowestvalue.Here is an extremely simple exploration to demonstrate
the problem:------------------------------------------// Explore
and Debug Trailing Stop logicfor( i = 1; i < BarCount; i++ ) // Pad
CoverPrice array with HIGH VALUES{CoverPrice[i] =
99999; }// I verified
that entire CoverPrice array now padded with 99999'sx = Min( Ref(H,-1)
, Ref(CoverPrice, -1) );CoverPrice = x;Filter =
1;AddColumn(x,"x = Min(Ref(H,-1),Ref(CoverPrice,
-1))",6.3);AddColumn(Ref(H, -1),"Ref(H,
-1)",6.3);AddColumn(Ref(CoverPrice,
-1),"Ref(CoverPrice,-1)",6.3);AddColumn(CoverPrice,"CoverPrice",6.3);AddColumn(H,"H",6.3);----------------------------------------Run
the above exploration against any current issue (I'm testing withSPY) in
AB and you will see that in the statement: x = Min(
Ref(H,-1) , Ref(CoverPrice, -1) );variable x is ALWAYS being assigned
the value of Ref(H, -1) instead ofthe lowest value of the two values.
Am I missing something or is this an AB issue that I need to refer
toTomasz?Regards,PhsstSend
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
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
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|