FIRST 15 minute intraday PIVOT TRADING SYSTEM.

yasu222

Active Member
#1
I require first 15 minutes of the trading day as pivot trading afl . only for intraday.
pivot = first15min.high+first15min.low+first15min.close/3
 
Last edited:

sr114

Well-Known Member
#4
code for the 1st 15 min pivot

Code:
 _SECTION_BEGIN("Background_Setting");
 SetChartBkGradientFill( ParamColor("BgTop", colorBlack),
 ParamColor("BgBottom", colorDarkGrey),ParamColor("TitleBack",colorBlack)); 
 SetChartBkColor(ParamColor("Outer Panel",colorPaleBlue));
 SetChartOptions(0,chartShowArrows|chartShowDates);
 SetBarsRequired(sbrAll,sbrAll);

 _SECTION_END();

 _SECTION_BEGIN("Time Calculation");

 beginTradeTime = ParamTime( "Start Time ", "9:15:00" );
 endTradeTime =   ParamTime( "End Time   ", "9:30:00" );

 tn = TimeNum();
 timecond = tn >= beginTradeTime AND tn <= endTradeTime ; 
 //Plot( timecond, "", colorDarkGrey, styleArea|styleOwnScale,0,1); 

 CR15High = deTimeRangeHHV(H,beginTradeTime ,endTradeTime );
 CR15Low = deTimeRangeLLV(L,beginTradeTime ,endTradeTime );
 CR15Clos = deValueWhenTime(C,endTradeTime );

 pp= (Cr15high+Cr15low+Cr15clos)/3;

 
 Today = LastValue(Day());

 Plot(IIf(Today == Day(),CR15High ,Null),"",colorBrightGreen,styleLine ); 
 Plot(IIf(Today == Day(),CR15Low ,Null),"",colorOrange,styleLine );
 Plot(IIf(Today == Day(),CR15clos ,Null),"",colorBlue,styleLine );
 Plot(IIf(Today == Day(),pp ,Null),"",colorSkyblue,styleLine );

 _SECTION_END();

 _SECTION_BEGIN("Price");
 SetBarFillColor(IIf(C>pp ,ParamColor("Candle Up Color", colorBrightGreen),IIf(C<pp ,ParamColor("Candle Down Color", colorRed),colorLightGrey)));
 Plot(C,"close",IIf(C>pp ,ParamColor("Shadow Up Color", colorBlack),IIf(C<pp ,ParamColor("Shadow Down Color", colorBlack),colorLightGrey)),64,0,0,0,0);
 GraphXSpace=Param("GraphXSpace",20,-10,25,1);
 _SECTION_END();

 _SECTION_BEGIN("Title");
 
 Title = 
 EncodeColor(colorBrightGreen)+ "Day 1st 15 min Pivot \n" +  Name() + " : " + EncodeColor(colorBrightGreen)+ Interval(2) 
 +EncodeColor(colorBrightGreen) + " : " + Date() +"\n\n"
 +EncodeColor(colorBrightGreen) + "1st 15 min Hi = " + EncodeColor(colorBrightGreen) + NumToStr(CR15High ,1.2) + "\n" 
 +EncodeColor(colorOrange) + "1st 15 min Lo = " + EncodeColor(colorOrange) + NumToStr(CR15Low ,1.2) + "\n"  
 +EncodeColor(colorBlue) + "1st 15 min Close = " + EncodeColor(colorBlue) + NumToStr(Cr15clos ,1.2) + "\n" 
 +EncodeColor(colorSkyblue) + "1st 15 min Pivot = " + EncodeColor(colorSkyblue) + NumToStr(pp,1.2);  

 _SECTION_END();
[requires dll plugin from 3rd Party - put the dll in plugin folder - otherwise the code will not work]
link : http://www.amibroker.org/3rdparty/deDateTime.zip
 
Last edited:

yasu222

Active Member
#6
code for the 1st 15 min pivot

Code:
 _SECTION_BEGIN("Background_Setting");
 SetChartBkGradientFill( ParamColor("BgTop", colorBlack),
 ParamColor("BgBottom", colorDarkGrey),ParamColor("TitleBack",colorBlack)); 
 SetChartBkColor(ParamColor("Outer Panel",colorPaleBlue));
 SetChartOptions(0,chartShowArrows|chartShowDates);
 SetBarsRequired(sbrAll,sbrAll);

 _SECTION_END();

 _SECTION_BEGIN("Time Calculation");

 beginTradeTime = ParamTime( "Start Time ", "9:15:00" );
 endTradeTime =   ParamTime( "End Time   ", "9:30:00" );

 tn = TimeNum();
 timecond = tn >= beginTradeTime AND tn <= endTradeTime ; 
 //Plot( timecond, "", colorDarkGrey, styleArea|styleOwnScale,0,1); 

 CR15High = deTimeRangeHHV(H,beginTradeTime ,endTradeTime );
 CR15Low = deTimeRangeLLV(L,beginTradeTime ,endTradeTime );
 CR15Clos = deValueWhenTime(C,endTradeTime );

 pp= (Cr15high+Cr15low+Cr15clos)/3;

 
 Today = LastValue(Day());

 Plot(IIf(Today == Day(),CR15High ,Null),"",colorBrightGreen,styleLine ); 
 Plot(IIf(Today == Day(),CR15Low ,Null),"",colorOrange,styleLine );
 Plot(IIf(Today == Day(),CR15clos ,Null),"",colorBlue,styleLine );
 Plot(IIf(Today == Day(),CR15clos ,Null),"",colorBlue,styleLine );

 Plot(IIf(Today == Day(),pp ,Null),"",colorSkyblue,styleLine );

 _SECTION_END();

 _SECTION_BEGIN("Price");
 SetBarFillColor(IIf(C>pp ,ParamColor("Candle Up Color", colorBrightGreen),IIf(C<pp ,ParamColor("Candle Down Color", colorRed),colorLightGrey)));
 Plot(C,"close",IIf(C>pp ,ParamColor("Shadow Up Color", colorBlack),IIf(C<pp ,ParamColor("Shadow Down Color", colorBlack),colorLightGrey)),64,0,0,0,0);
 GraphXSpace=Param("GraphXSpace",20,-10,25,1);
 _SECTION_END();

 _SECTION_BEGIN("Title");
 
 Title = 
 EncodeColor(colorBrightGreen)+ "Day 1st 15 min Pivot \n" +  Name() + " : " + EncodeColor(colorBrightGreen)+ Interval(2) 
 +EncodeColor(colorBrightGreen) + " : " + Date() +"\n\n"
 +EncodeColor(colorBrightGreen) + "1st 15 min Hi = " + EncodeColor(colorBrightGreen) + NumToStr(CR15High ,1.2) + "\n" 
 +EncodeColor(colorOrange) + "1st 15 min Lo = " + EncodeColor(colorOrange) + NumToStr(CR15Low ,1.2) + "\n"  
 +EncodeColor(colorBlue) + "1st 15 min Close = " + EncodeColor(colorBlue) + NumToStr(Cr15clos ,1.2) + "\n" 
 +EncodeColor(colorSkyblue) + "1st 15 min Pivot = " + EncodeColor(colorSkyblue) + NumToStr(pp,1.2);  

 _SECTION_END();
[requires dll plugin from 3rd Party - put the dll in plugin folder - otherwise the code will not work]
link : http://www.amibroker.org/3rdparty/deDateTime.zip
pivot not visible in the chart
 

Similar threads