Hi

On the code below, can anyone advise how to make the moving average 
appear on the chart during the night session?

Many thanks

Ken


// Variable Timeframe
TimeFrameSet( in5Minute ); // switch to 5 minute frame 

TimeFrame= Param("Chart Timeframe (min)",5,5,60,5)*60; 

TimeFrameSet(TimeFrame); 

TN = TimeNum(); 

ParamStartTime = ParamTime("Session Start","09:50:00"); 

ParamEndTime = ParamTime("Session End","16:30:00"); 

InSessionTime = TN >= ParamStartTime AND TN <= ParamEndTime; 

StartOfSession = InSessionTime > Ref(InSessionTime,-1); 

EndOfSession = InSessionTime < Ref(InSessionTime,-1); 

InsessionTime = InSessionTime OR EndOfSession;

_SECTION_END();

_SECTION_BEGIN("PLOTTING");

Plot( C, "Close", ParamColor("Color", colorYellow ), styleNoTitle | 
ParamStyle("Style") | GetPriceStyle() ); 
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{ 
{
 ToolTip=StrFormat("Open: %g\nHigh:  %g\nLow:   %g\nClose:  %g (%.1f%
%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 
1 )));
}
Plot( InSessionTime,"",1,styleArea|styleOwnScale|styleNoLabel,0,550); 

Plot( StartOfSession,"",1,styleArea|styleOwnScale|styleNoLabel,0,30); 

Plot( EndOfSession,"",4,styleArea|styleOwnScale|styleNoLabel,0,30); 
} 
OutOfSessionColor = ParamColor("Out of Session",colorDarkRed); 

Plot(NOT 
InSessionTime,"",OutOfSessionColor,styleArea|styleOwnScale|styleNoLabe
l,0,1); 

if(ParamToggle("Equity curve","HIDE|SHOW",0) ) 
{ 
Plot(TradeEquity,"",2,styleStaircase|styleOwnScale); 
}
_SECTION_END();



_SECTION_BEGIN("MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 8, 2, 200, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", 
colorCycle ), ParamStyle("Style") ); 
_SECTION_END();

Reply via email to