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

Code Snippet : Price with Last Trade Price Marker : Amibroker

38 sec read

Here is a simple Amibroker AFL code snippet which tracks the last trade price with a dashed horizontal line at LTP. It could be useful for the people who wants to know where the current market price is trading relative to their support/resistance/some other reference levels.

Amibroker Chart with LTP Marker

Simple Control is enabled to change the line color and style. To Access the control right click over the charts and goto parameters to change the required parameters.

Amibroker Parameter Control Options

Amibroker AFL Code Snippet for Price with LTP Marker

 

//Coded by Rajandran R
//Founder of www.marketcalls.in
//Co-Founder - www.traderscafe.in

_SECTION_BEGIN("Price with LTP Line Marker");
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() ); 

bi= BarIndex();

sbi = FirstVisibleValue(bi);
ebi = LastVisibleValue(bi);

Plot(LineArray(sbi, C[BarCount-1], ebi, C[BarCount-1],1),"",ParamColor("LTP Color", coloryellow ), ParamStyle("LineStyle") | styleDashed | styleNoLabel | styleNoTitle);


_SECTION_END();
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

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

[Live Coding Webinar] Build Your First Trading Bridge for…

In this course, you will be learning to build your own trading bridge using Python. This 60-minute session is perfect for traders, Python enthusiasts,...
Rajandran R
1 min read

Leave a Reply

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