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

[amibroker] Portfolio position sizing code idea



PureBytes Links

Trading Reference Links


Jayson, Ara - Thanks, I appreciate the help.
If anyone is interested I put in a YTD% return in the upper right hand corner on one of my chart templates:
 

b = 1031231;
a=DateNum()==b;
i=ValueWhen(a,C);
ii = ((C-i)/i)*100;
Title = Name() + " - " + WriteVal( DateTime(), formatDateTime ) + " - " + " Open: " + O + ", Hi: " + H + ", Low: " + L + ", Close: " + C + " " + NumToStr(a,1.2) + "%" + ", Volume: " + Writeb =
 WriteVal(V,1)+ " " + EncodeColor( colorYellow) +" YTD % change: " + NumToStr(ii,1.2) + "%" ; 
Ara Kaloustian <ara1@xxxxxxxxxx> wrote:




Valuewhen(DateNUM()==x,Close,1);

----- Original Message ----- 
From: Jayson 
To: amibroker@xxxxxxxxxxxxxxx 
Sent: Thursday, February 05, 2004 8:18 AM
Subject: RE: [amibroker] datenum() function

Jason,
how about valuewhen()?
i=valuewhen(a,c);
 
Regards, 
Jayson 
-----Original Message-----From: Jason Hart [mailto:jhart_1972@xxxxxxxxx]Sent: Thursday, February 05, 2004 10:48 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] datenum() function
any idea how I would configure this so that it returns the close from 12/31?  I thought it was going to be easy but I've hit a roadblock!  I gave this a shot .....no luck though
 

b = 1031231;
a=DateNum()==b;
r= Ref(C,a);
 
Jason Jayson <jcasavant@xxxxxxxxxxx> wrote:


Jason,
try.....
 
 a=datenum()==b;
 
Regards, 
Jayson 
-----Original Message-----From: Jason Hart [mailto:jhart_1972@xxxxxxxxx]Sent: Thursday, February 05, 2004 9:31 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] datenum() function


I'm trying to incorporate a chart that marks the date 12/31/03.  How do I let the datenum() function know which date I'm after?  The only luck I've had so far is returning the most recent date.  I've tried this but no luck
b = 1031231;
a = DateNum(b);
Jason  


Do you Yahoo!?Yahoo! Finance: Get your refund fast by filing online Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 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 Send 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: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 


Do you Yahoo!?Yahoo! Finance: Get your refund fast by filing online Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 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 Send 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: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 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 
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online


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 the Yahoo! Terms of Service.