Demand Supply Trading System


Demand Supply Trading System
Demand Supply Trading System


//www.aflcode.com
_SECTION_BEGIN( "Demand and Supply Bars" );
GraphXSpace=10;
TopWick = IIf( Close > Open, High - Close, High - Open );
BotWick = IIf( Close > Open, Open - Low, Close - Low );

SBCond1 = TopWick > Ref( TopWick, -1 ) AND TopWick > Ref( TopWick, 1 );
SBCond2 = High > Ref( High, -1 ) AND High > Ref( High, 1 );
SBCond3 = Ref( TopWick, -1 ) > 0.009 AND Ref( TopWick, 1 ) > 0.009;

DBCond1 = BotWick > Ref( BotWick, -1 ) AND BotWick > Ref( BotWick, 1 );
DBCond2 = Low < Ref( Low, -1 ) AND Low < Ref( Low, 1 );
DBCond3 = Ref( BotWick, -1 ) > 0.009 AND Ref( BotWick, 1 ) > 0.009;

SpplyBar = IIf( SBCond1 AND SBCond2 AND SBCond3, shapeCircle, shapeNone );
DmndBar = IIf( DBCond1 AND DBCond2 AND DBCond3, shapeCircle, shapeNone );

PlotShapes( SpplyBar, ParamColor( "SupplyBar Color", colorRed ), 0, H, 10 );
PlotShapes( DmndBar, ParamColor( "DemandBar Color", colorGreen ), 0 , L, -10 );
_SECTION_END();

_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", IIf(C>=O,colorGreen,colorRed), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("Volume At Price");
PlotVAPOverlay( Param("Lines", 300, 100, 1000, 1 ), Param("Width", 5, 1, 100, 1 ), ParamColor("Color", colorCycle ), ParamToggle("Side", "Left|Right" ) | 4*ParamToggle("Z-order", "On top|Behind", 1 ) );
 
_SECTION_END();

Previous
Next Post »