Rajandran R Creator of OpenAlgo - OpenSource Algo Trading framework for Indian Traders. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, 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. Building Algo Platforms, Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in

One Timeframing and Amibroker Exploration Code

1 min read

One Timeframing is a simple, powerful, and popular concept when comes to a market profile trader. One Timeframing generally refers to a market that is trending in one direction. In simpler terms candlesticks constantly making higher lows and the consecutive candles should not breach the lows of the previous candle by not more than 2-ticks in the up-trending move then it is called One-Timeframing Up. IF the candles/bars are constantly making lower high and and the consecutive candles should not breach the high of the previous candle by not more than 2-ticks in the down-trending move then it is called One-Timeframing Down.

One timeframing
[wp_ad_camp_5]

One-timeframing happens across all the timeframes but from an intraday trading perspective 30min daily profile charts provide a meaningful indication for mean reversion trading. Either one can practice mean-reversion trading, partial profit booking or tighten/trail his stops when one timeframe occurs on 30min charts.

Post One Timeframing occurrence either the market can balance(move sideways) near the Onetimeframe zone or mean revert. One Timeframing is a very good visual concept from a day timeframe trader’s perspective. The following One Timeframing Indicator and Amibroker Exploration provide one-timeframing indication with red and green circles and indicate the presence of one-timeframing visually. The afl code looks for a minimum of 4 consecutive candles for the occurrence of one timeframe activity.

One Timeframing Amibroker Exploration Code

//Coded By Rajandran R
//Date : 12 Jan 2016

_SECTION_BEGIN("One Timeframing Exploration");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

OTsell = Ref(H,-4)< Ref(H,-3) AND Ref(H,-3)< Ref(H,-2) AND Ref(H,-2)< Ref(H,-1);
		
		
OTbuy = Ref(L,-4)> Ref(L,-3) AND Ref(L,-3)> Ref(L,-2) AND Ref(L,-2)> Ref(L,-1);
		

shapes =  IIf(OTsell,shapeHollowCircle,IIf(OTbuy,shapeHollowCircle,Null));
color = IIf(OTsell,colorred,IIf(OTbuy,colorgreen,Null));
offset = IIf(OTsell,H,IIf(OTbuy,L,Null));

PlotShapes(Ref(shapes,1),Ref(color,1),0,Ref(offset,1),-12,0);

Filter = OTsell OR OTbuy;

AddColumn(C,"Close",1.2);
AddColumn(Ref(OTbuy,1),"OT Buy",1);	
AddColumn(Ref(OTsell,1),"OT Sell",1);		

_SECTION_END();

Download One Timeframing Amibroker Exploration

Note: we are interested only in consecutive candles whereas the textbooks and the internet reference might differ as many consider inside bar which still not breaking the previous bar high/low and making higher high or lower low also as a part of One-Timeframing.

Rajandran R Creator of OpenAlgo - OpenSource Algo Trading framework for Indian Traders. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, 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. Building Algo Platforms, Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in

How to Prepare for Morning Trade Using Market Profile

Successful trading is not just about having the right strategy; it's also about preparation, especially when it comes to the volatile opening hours of...
Rajandran R
3 min read

Interactive Brokers – Smart Order Chart Trading Module using…

The IB Controller is an interface designed to facilitate automatic trading with AmiBroker and Interactive Brokers (IB) TWS (Trader Workstation). It serves as a...
Rajandran R
8 min read

Introducing OpenAlgo V1.0: The Ultimate Open-Source Algorithmic Trading Framework…

OpenAlgo V1.0 is an open-source algorithmic trading platform to automate your trading strategies using Amibroker, Tradingview, Metatrader, Python etc. Designed with the modern trader...
Rajandran R
2 min read

9 Replies to “One Timeframing and Amibroker Exploration Code”

  1. PlotShapes(Ref(shapes,1),Ref(color,1),0,Ref(offset,1),-12,0);

    error 16 throws – Too many arguments

    I have reviewed the AFL function reference and it looks correct syntax only. Unable to fix the bug.

    Please solve it.

  2. please explain me :- can this AFL( one timeframing ) be useful for charts showing EOD candles?
    i am using amibroker 5.9

Leave a Reply

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