Re: [amibroker] Re: 4 weeks candles/backtesting [1 Attachment]

 
[Attachment(s) from portfoliobuilder99@gmail.com [amibroker] included below]

I came up with a rolling 4 week bar, that updates every week if you set your chart to Weekly periodicity.


It will give you the past 4 weeks Open, High, Low, Close.

For your purpose you could just check it at the end of each month.
////////////////////////////////////////////////////////////////////////////////
// set chart to WEEKLY
// creates a rolling window over past 4 bars
////////////////////////////////////////////////////////////////////////////////

FourWeekO=Ref(O,-3);
FourWeekH=HHV(H,4);
FourWeekL=LLV(L,4);
FourWeekC=Close;

PlotOHLC(FourWeekO,FourWeekH,FourWeekL,FourWeekC,"4 Week Bar", styleCandle);

Filter=1;
AddColumn(Open, "Open");
AddColumn(High, "High");
AddColumn(Low, "Low");
AddColumn(Close, "Close");
AddColumn(FourWeekO, "4 week O", 1.2, colorBlue, colorlime);
AddColumn(FourWeekH, "4 week H", 1.2, colorBlue, colorlime);
AddColumn(FourWeekL, "4 week L", 1.2, colorBlue, colorlime);
AddColumn(FourWeekC, "4 week C", 1.2, colorBlue, colorlime);
//////////////////////////////////////////////////////////////////////////////////////////////////////////

But maybe these posts will help get you what you are looking for (easy to use daily, but I was unable to use the same procedure for weekly)




__._,_.___

Attachment(s) from portfoliobuilder99@gmail.com [amibroker] | View attachments on the web

1 of 1 Photo(s)


Posted by: portfoliobuilder99@gmail.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

Check out the automatic photo album with 2 photo(s) from this topic.
first day every 4th week.PNG rolling 4 week bar.PNG

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon