Skip to content

Instantly share code, notes, and snippets.

_SECTION_BEGIN("Price");
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() );
_SECTION_END();
_SECTION_BEGIN("Bollinger Bands");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 100, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
@DTM-SC
DTM-SC / PSAR AFL
Last active January 4, 2020 05:00
// This PSAr AFL is developed by DTM - www.Dailytrademantra.com
ThisColor = IIf( C>O, Colorgreen, IIf(C<O, Colorred, colorBlack));
PlotOHLC( O, H, L, C, "", ThisColor, styleCandle|styleNoLabel,0,-5,0);
_N(Title = StrFormat("{{NAME}} " + EncodeColor(colorBrightGreen) + " {{DATE}} " + EncodeColor(colorYellow) +" Open: %g " + EncodeColor(colorLime) +" High: %g " + EncodeColor(colorOrange) +" Low: %g "+ EncodeColor(colorYellow) + " Close: %g {{VALUES}} ", O, H, L, C));
_SECTION_BEGIN("PSAR Plot");
accel_f = Param("Acc Factor", 0.02, 0, 1, 0.01);
@DTM-SC
DTM-SC / Fundamental AFL
Last active May 28, 2019 09:59
Fundamental AFL by DTM
/*This AFL is to identify the Fundamental details of any stock and plot them with few parameterised Averages
This is useful for investers who want to identify stocks based on fundamental data and combine them with some moving averages value to invest at the right time for long term investment
We have added exploration too for your benefit, please ensure your data provider provides you the fundamental data for this AFL to work
*/
_SECTION_BEGIN("Average 1");
//Average_switch = ParamToggle("Candle On/off", "Off|On");
P = ParamField("Field");
Type = ParamList("Type", "Exponential,Weighted,Linear Regression,Double Exponential,Tripple Exponential,Wilders,Simple");
Periods = Param("Periods", 9, 2, 200 );
@DTM-SC
DTM-SC / Fibonaci Retracement
Last active May 22, 2019 17:49
Fibonacci Retracement AFL
/*This AFL looks back 60 candles and plots the Fibonnaci lines from 60 till latest candle based on High and Low during that period
Tried to keep this simple to understand and plot. This can be converted into a Strategy based on your requirement */
_SECTION_BEGIN("DTM Fibonacci Retracement");
GraphXSpace=2;
Plot(C,"", colorWhite,styleCandle);
EndBar = EndValue(BarIndex());
StartBar = EndBar-60; // To plot Fibonnaci lines from last 60 bars, this can be customised based on your requirement
@DTM-SC
DTM-SC / Simple SuperTrend AFL
Last active October 19, 2019 21:17
SuperTrend AFL
/* This AFL is to plot Supertrend for Swing Trading, this can also be sued for Intraday Supertrend, I would suggest
to use the AFL for any time frame based on your strategy planning. The default multiplier is 1 and period used as 7 for ATR, you can use as per your strategy.
*/
_SECTION_BEGIN("Supertrend AFL");
SetChartOptions(0,chartShowArrows|chartShowDates);
SetBarFillColor(IIf(C>O,ParamColor("UP Color", colorGreen),IIf(C<=O,ParamColor("Down Color", colorRed),colorLightGrey)));
Plot(C,"Price",IIf(C>O,ParamColor("Wick UP Color", colorLime),IIf(C<=O,ParamColor("Wick Down Color", colorOrange),colorLightGrey)),styleCandle | styleNoTitle);
@DTM-SC
DTM-SC / gist:e8044b11828ee3c2754f323ef613486e
Created May 18, 2019 04:17
Open Range Breakout (ORB) Intraday
/* This is simple ORB Breakout AFL, can be planned for any Breakout Strategy, Run explorer to see the data points
Planned for 15 MIn candle as default, but you can plan this strategy based on your need. The breakout is mentioned below for 15 minute candle for Indian market
Developed by DTM FInancial Solutions www.dailytrademantra.com
Please contact us for any clarification or further query : [email protected]
*/
_SECTION_BEGIN("ORB Breakout AFL");
_SECTION_BEGIN("Plot a CANDLESTICK Chart");
_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",colorBlue), styleCandle);
Plot( C, "Close", ParamColor("Color",colorBlue), styleCandle);
Plot(EMA(C,26),"EMA26",ParamColor("EMA26Color",colorLightOrange));
Plot(EMA(C,9),"EMA9",ParamColor("EMA9Color",colorBrightGreen));
_SECTION_BEGIN("EMA-9×26 Crossover by Daily Trade Mantra");
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",colorBlue), styleCandle);
EMAfast = EMA(C, 9);
EMAslow = EMA(C, 26);
PriceBuysignal = 0;
PriceShortsignal = 0;