Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

21 day Twiggs Money AFL Code for Amibroker

1 min read

Twiggs money flow indicator is nothing but a modified version of the Chaikin Money Flow indicator. Twiggs money flow is primarily used for trend confirmation when the price is breaking out or showing trend weakness when the divergence is building

How to use Twiggs Money Flow?

Twiggs Money Flow signals accumulation if above zero, while negative values signal distribution. The higher the reading (above or below zero), the stronger the signal.

  • Go long if a breakout above resistance is supported by Twiggs Money Flow above zero.
  • Go short if a breakout below support is confirmed by negative Twiggs Money Flow.

Divergences also provide good signals:

  • Go long on a bullish divergence.
  • Go short on a bearish divergence.

The strongest confirmation of the above signals is when either:

  • Twiggs Money Flow is trending upwards and completes a trough without crossing below zero, or
  • Twiggs Money Flow trends downwards and completes a peak without crossing above zero.

Download Twiggs Money Flow Indicator for Amibroker

_SECTION_BEGIN("Twiggs Money Flow");
/*
Twiggs Money Flow is a derivation of Chaikin Money Flow indicator, which is in
turn derived from the Accumulation Distribution line.
However, Twiggs Money Flow makes two basic improvements to the Chaikin Money
Flow formula:
1-To solve the problem with gaps, Twiggs Money Flow uses true range, rather
than daily Highs minus Lows. 
2-And, rather than a simple-moving-average-type formula, Twiggs Money Flow
applies exponential smoothing, using the method employed by Welles Wilder for
many of his indicators.
 */

periods = Param( "Periods", 21, 5, 200, 1 );
color = ParamColor("Color",colorYellow);

TRH=Max(Ref(C,-1),H);
TRL=Min(Ref(C,-1),L);
TR=TRH-TRL;
ADV=V*((C-TRL)-(TRH-C))/ IIf(TR==0,9999999,TR);
WV=V+(Ref(V,-1)*0);
SmV= Wilders(WV,periods);
SmA= Wilders(ADV,periods);

TMF= IIf(SmV==0,0,SmA/SmV);
Plot( TMF, _DEFAULT_NAME(), color,styleThick );
_SECTION_END();
Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

How to Perform Machine Learning Using Amibroker and Python

Amibroker is a powerful technical analysis and trading system development platform, used extensively by traders and analysts for developing and deploying trading strategies. Python,...
Rajandran R
5 min read

Preparing the Features Dataset using Amibroker Exploration – Machine…

There are various methods to prepare the feature dataset, which is a crucial input for a machine learning prediction model. One approach is to...
Rajandran R
1 min read

Dynamic Color Coding in Amibroker Profit Tables: A Visually…

Profit tables are a valuable tool for traders and investors to analyze the trading strategy performance of their investments over time. However, the traditional...
Rajandran R
3 min read

One Reply to “21 day Twiggs Money AFL Code for Amibroker”

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More