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

Re: [amibroker] Re: Addcolumn( close x days after buydate ....) : [AFL gurus please]



PureBytes Links

Trading Reference Links

Thanks Fred.
 
This works great.
for a non - programmer the frustrating thing this is such simple code!
 

// ---- TEST close at X DAYS AFTER BUY --- //

Buy = Cross(C,EMA(C,10));// for eg

Filter = Buy;

Sell =0;

AddColumn(C,"C",1.2);

//AddColumn(ValueWhen(Ref(Buy,-10),Close),"x10");// not the result I was looking for.//

AddColumn(Ref(C, 2), "2dayson");//bingo

AddColumn(Ref(C,3),"3 dayson");// bingo

AddColumn(Ref(C,4),"4 days on");// bingo

 
Many thanks
ChrisB

Fred <ftonetti@xxxxxxxxxxxxx> wrote:

Given that you're filtering based on buy then try ...

AddColumn(Ref(C, 10), whatever ...

Notice there's NO negative ... 

--- In amibroker@xxxxxxxxxxxxxxx, kris45mar <kris45mar@xxxx> wrote:
> Hi all.
> Could I ask for help with this concept please: I wish to explore 
for a buy condition and then add columns for the closing price x 
number of days after the buydate.
> This to be exported to Excel.
>  
> I am stuck with barsince,datenum, barindex, etc.
> 
> //sample...
> 
> Buy = Cond1;
> 
> SetTradeDelays(1,1,1,1);
> 
> Sell =0;
> 
> Filter = Buy;
> 
> AddColumn(Close,"buyprice",1.2);
> 
> // How to add a column showing the close 10 days after the buy 
date...
> 
> // then add a column showing the close 20 days after the buy 
date....
> 
> //...etc
> 
>  
> Any help, guidance, tips appreciated.
>  
> Regards
>  
> ChrisB
> 
>             
> ---------------------------------
> Do you Yahoo!?
> vote.yahoo.com - Register online to vote today!
> 
> [Non-text portions of this message have been removed]





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

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


Yahoo! Groups SponsorADVERTISEMENT


---------------------------------
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. 


		
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/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/