SetChartOptions( 0, chartWrapTitle | chartShowArrows | chartShowDates, 0 );
_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_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA3");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA4");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA5");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA6");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
//plot candles only from 9:15 am to 9:30 am :)
tn=TimeNum();
tnn=tn>=91500 AND tn<=93000;
Price = IIf( tnn, Close, Null );
SetChartOptions(0,chartShowArrows|chartShowDates,0);
_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( Price, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//plot volume only from 9:15 am to 9:30 am :)
tn=TimeNum();
tnn=tn>=91500 AND tn<=93000;
VV = IIf( tnn, V, Null );
VV = IIf( tnn, V, Null );
SetChartOptions(0,chartShowArrows|chartShowDates,0);
Plot( VV, _DEFAULT_NAME(), ParamColor("Color", colorBlueGrey ), ParamStyle( "Style", styleHistogram | styleOwnScale | styleThick, maskHistogram ) );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SetChartOptions( 0, chartWrapTitle | chartShowArrows | chartShowDates, 0 );
_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_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA3");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA4");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA5");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA6");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
Same_timeframe_but_diff_values = ParamToggle("Ema with same TF but diff values","Yes|No",1);
Diff_timeframe_but_same_values = ParamToggle("Diff_timeframe_but_same_values","Yes|No",0);
SetChartOptions(0,chartShowArrows|chartShowDates,0);
_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() );
if (Diff_timeframe_but_same_values==1)
{
_SECTION_BEGIN("EMA 5 MIN");
EM5=ParamToggle("EMA5","Off|On",1);
if(EM5)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(in5Minute);
m5= EMA(Close,p) ;
Plot(TimeFrameExpand(m5, in5Minute), "", ParamColor( "5 Min Color", colorRed ), styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA 15 MIN");
EM15=ParamToggle("EMA15","Off|On",1);
if(EM15)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(in15Minute);
m15= EMA(Close,p) ;
Plot(TimeFrameExpand(m15, in15Minute), "", ParamColor( "15 Min Color", colorBlue ),styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA Hourly");
EMH=ParamToggle("EMAH","Off|On",1);
if(EMH)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(inHourly);
mH= EMA(Close,p) ;
Plot(TimeFrameExpand(mH, inHourly), "", ParamColor( "Hourly Color", colorGreen ),styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA 2Hourly");
EM2H=ParamToggle("EMA2H","Off|On",1);
if(EM2H)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(inHourly*2);
m2H= EMA(Close,p) ;
Plot(TimeFrameExpand(m2H, inHourly*2), "", ParamColor( "2Hour Color", colorYellow ),styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA 4Hourly");
EM4H=ParamToggle("EMA4H","Off|On",1);
if(EM4H)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(inHourly*4);
m4H= EMA(Close,p) ;
Plot(TimeFrameExpand(m4H, inHourly*4), "", ParamColor( "4Hour Color", colorOrange ),styleStaircase|styleThick);
TimeFrameRestore();
}
_SECTION_END();
}
if(Same_timeframe_but_diff_values==1)
{
_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA3");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA4");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA5");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA6");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
}
Same_timeframe_but_diff_values = ParamToggle("Ema with same TF but diff values","Yes|No",1);
Diff_timeframe_but_same_values = ParamToggle("Diff_timeframe_but_same_values","Yes|No",1);
SetChartOptions(0,chartShowArrows|chartShowDates,0);
_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() );
if (Diff_timeframe_but_same_values==1)
{
_SECTION_BEGIN("EMA 5 MIN");
EM5=ParamToggle("EMA5","Off|On",1);
if(EM5)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(in5Minute);
m5= EMA(Close,p) ;
Plot(TimeFrameExpand(m5, in5Minute), "", ParamColor( "5 Min Color", colorRed ), styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA 15 MIN");
EM15=ParamToggle("EMA15","Off|On",1);
if(EM15)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(in15Minute);
m15= EMA(Close,p) ;
Plot(TimeFrameExpand(m15, in15Minute), "", ParamColor( "15 Min Color", colorBlue ),styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA Hourly");
EMH=ParamToggle("EMAH","Off|On",1);
if(EMH)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(inHourly);
mH= EMA(Close,p) ;
Plot(TimeFrameExpand(mH, inHourly), "", ParamColor( "Hourly Color", colorGreen ),styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA 2Hourly");
EM2H=ParamToggle("EMA2H","Off|On",1);
if(EM2H)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(inHourly*2);
m2H= EMA(Close,p) ;
Plot(TimeFrameExpand(m2H, inHourly*2), "", ParamColor( "2Hour Color", colorYellow ),styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA 4Hourly");
EM4H=ParamToggle("EMA4H","Off|On",1);
if(EM4H)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(inHourly*4);
m4H= EMA(Close,p) ;
Plot(TimeFrameExpand(m4H, inHourly*4), "", ParamColor( "4Hour Color", colorOrange ),styleStaircase|styleThick);
TimeFrameRestore();
}
_SECTION_END();
}
if(Same_timeframe_but_diff_values==1)
{
_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA3");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA4");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA5");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA6");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
}
Same_timeframe_but_diff_values = ParamToggle("Ema with same TF but diff values","Yes|No",1);
Diff_timeframe_but_same_values = ParamToggle("Diff_timeframe_but_same_values","Yes|No",1);
SetChartOptions(0,chartShowArrows|chartShowDates,0);
_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() );
if (Diff_timeframe_but_same_values==1)
{
_SECTION_BEGIN("EMA 5 MIN");
EM5=ParamToggle("EMA5","Off|On",1);
if(EM5)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(in5Minute);
m5= EMA(Close,p) ;
Plot(TimeFrameExpand(m5, in5Minute), "", ParamColor( "5 Min Color", colorRed ), styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA 15 MIN");
EM15=ParamToggle("EMA15","Off|On",1);
if(EM15)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(in15Minute);
m15= EMA(Close,p) ;
Plot(TimeFrameExpand(m15, in15Minute), "", ParamColor( "15 Min Color", colorBlue ),styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA Hourly");
EMH=ParamToggle("EMAH","Off|On",1);
if(EMH)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(inHourly);
mH= EMA(Close,p) ;
Plot(TimeFrameExpand(mH, inHourly), "", ParamColor( "Hourly Color", colorGreen ),styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA 2Hourly");
EM2H=ParamToggle("EMA2H","Off|On",1);
if(EM2H)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(inHourly*2);
m2H= EMA(Close,p) ;
Plot(TimeFrameExpand(m2H, inHourly*2), "", ParamColor( "2Hour Color", colorYellow ),styleLine|styleThick);
TimeFrameRestore();
}
_SECTION_END();
_SECTION_BEGIN("EMA 4Hourly");
EM4H=ParamToggle("EMA4H","Off|On",1);
if(EM4H)
{
p=Param("Periods",5,1,1000,1);
TimeFrameSet(inHourly*4);
m4H= EMA(Close,p) ;
Plot(TimeFrameExpand(m4H, inHourly*4), "", ParamColor( "4Hour Color", colorOrange ),styleStaircase|styleThick);
TimeFrameRestore();
}
_SECTION_END();
}
if(Same_timeframe_but_diff_values==1)
{
_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA3");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA4");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA5");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA6");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();
}