Plot 3 Week pivot point on daily chart (newbie)

I have been struggling with this for a while. I am trying to plot on a daily chart a 3 week pivot point. Using the High, Low and Last weekly close / 3. It should only look at the last completed week ( so not the current).

I am sure this is easy for someone but excruciating difficult for me. I havent been able to find any help on this forum or anywhere else.

Thanks in advance.

@smedlex Scott, welcome to the forum.

Your best place to start is with what you have tried. Show us what you are doing, and what is not working.

With your recent joining, and little "read" time, we don't know if you have done nothing, or have been working with AFL for a while and just need help with this one concept.

So, if you need the basics, try this: How do I learn AFL? and then learn more about explorations to see what you can do: Scan, Exploration Back Test

If you already now enough, post your code (using the code blocks) and tell us where your issue is. Then we will have an idea how to help.

Hello Scott,

Adding to what Snoopy has mentioned, let me give you a hint. The solution to your query lies here - Multiple Time Frame support in AFL. You need to try out the examples in this tutorial and understand how to compress and expand slower (higher) timeframes within faster (lower) ones.

If you manage to solve on how to plot previous week's OHLC onto the current week's daily chart, you will easily figure out on how to tweak it for Previous N period anyways and can calculate anything out of it.

Cheerish it !

1 Like

Many thanks,
I got there in the end.
Now onto my next struggle!

2 Likes

As they say "No pain, no gain": keep it up and in few weeks you'll be surprised of your progress!

@smedlex It is great that you have found your solution! May I suggest you mark this thread as "solved" but also post your solution so that in the future another newbie looking into a similar question (your question will turn up on future searches) can learn from your experience.

Thanks, and welcome to AmiBroker.

No worries, here is what I came up with. May not be pretty, but gets the job done ( just like me) :wink:

// WK123L IS PREVIOUS 3 WEEKS LOW.

wk1l = TimeFrameGetPrice( "low", inWeekly, -1);
wk2l = TimeFrameGetPrice( "low", inWeekly, -2);
wk3l = TimeFrameGetPrice( "low", inWeekly, -3);
WK12l = IIf(WK1l < WK2l, WK1l, WK2l);
WK123l = IIf(WK12l < WK3l, WK12l, WK3l);

// WK123H IS PREVIOUS 3 WEEK HIGH

wk1h = TimeFrameGetPrice( "High", inWeekly, -1);
wk2h = TimeFrameGetPrice( "High", inWeekly, -2);
wk3h = TimeFrameGetPrice( "High", inWeekly, -3);
WK12 = IIf(WK1H > WK2H, WK1H, WK2H);
WK123H = IIf(WK12 > WK3H, WK12, WK3H);

// LSTWKCL IS PREVIOUS WEEK CLOSE

LSTWKCL = TimeFrameGetPrice( "Close", inWeekly, -1);

THREEWPP = (WK123L + WK123H + LSTWKCL )/3 ;


Plot( THREEWPP, "3WPP", colorGold, styleLine,0,0,0,0,0);

Cheers