Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
TWAP for Amibroker (AFL)
Hi all, this is an attempt to do twap indicator. Please correct me if I’m wrong,,,
Indicator / Formula
_SECTION_BEGIN("TWAP"); /* The TWAP for a stock is calculated by Averaging OHLC in each bar then averaging the whole previous bars Jarrah */ Bars_so_far_today = 1 + BarsSince( Day() != Ref(Day(), -1)); StartBar = ValueWhen(TimeNum() == 090000, BarIndex()); TodayClose = Sum(C,Bars_so_far_today); TodayHigh = Sum(H,Bars_so_far_today); TodayLow = Sum(L,Bars_so_far_today); TodayOpen = Sum(O,Bars_so_far_today); TWAP = (TodayClose + TodayHigh + TodayLow + TodayOpen)/4 ; IIf (BarIndex() >= StartBar, ATWAP = TWAP / Bars_so_far_today,0); Plot (ATWAP,"TWAP",colorYellow, styleThick); _SECTION_END();
10 comments
Leave Comment
Please login here to leave a comment.
Back
how to trade
this indicator for learning purpose please don’t use it as a trading indicator,the time weighted average price. is theaverage of OHLC prices for all previous bars to indicate a resistance of intraday trading. its just an attempt to start i welcome your comment,,,,
Hallo Mr Tradinology
First of all I would like to Thank You for your TWAP AFL. It’s a good idea.
When I create the line TWAP_5 and line TWAP_10, how to add an arrow signal to the intersection of the two lines.
I’ve tried several times but failed.
Thanks in advance Mr Tradinology
Dear bambanghk, unfortunately I’m new with afl. but i hope our friends here can contribute for solution,
OK Thank you Mr Tradinology
Please anyone can help ?
Hello bambanghk,
the problem is in
you should be using the arrays ATWAP_10 and ATWAP_5
the below code worked for me :
That’s work Mr Tradinology
Thank you, Big Thank You
You’re most welcome, if you have any idea that can help make this indicator more useful pls share so everyone can learn something new,,,
thanks
It’s a filter code in (explone) in AmiBroker based in the indicator Ichimoku Kinko Hyo chart of the full range of items as shown in the table. filtering based on the chart and the Ichimoku signals are as follows;
strong buy signal; tenkansen cut prices or Kijun sen from the bottom up position above the clouds cut kumo, the direction from the bottom up. tenkan Kijun above the clouds from below kumo. Price cloud kumo break upward.
Weak buy signal; price cut tenkan sen sen or Kijun upward position kumo cloud bottom cutter, cut up Kijun sen sen Tankan bottom kumo cloud.
All the signals occurred in the context of cloud kumo average signals are buy and sell even.
Strong sell signal: price cut Tankan sen sen or Kijun from above down to the lower cutter cloud kumo
Weak sell signal; Tankan cut prices or Kijun sen sen from above down to the blades above the cloud kumo
big thanks! very transparent indicator. Helpful!!!