The daily statistic (e.g. standard deviation) doesn't show up on 1-minute to 5-minute charts, but shows up fine on 6-minute or longer. See output, code, and database setting below. Thanks for helping.
/*
Overnight Return Stats.
*/
procedure SetGapOpenStat( len )
{
global Chg_ON, Std_chg_ON, Z_chg_ON;
C_d = TimeFrameCompress( C, inDaily, compressLast );
O_d = TimeFrameCompress( O, inDaily, compressOpen );
Chg_ON = ( O_d / Ref( C_d, -1 ) - 1.0 ) * 100.0;
Std_chg_ON = StDev( chg_ON, len, False );
Z_chg_ON = ( Chg_ON - MA( Chg_ON, len ) ) / Std_chg_ON;
Chg_ON = TimeFrameExpand( Chg_ON, inDaily, expandFirst );
Std_chg_ON = TimeFrameExpand( Std_chg_ON, inDaily, expandFirst );
Z_chg_ON = TimeFrameExpand( Z_chg_ON, inDaily, expandFirst );
}
len = Param( "Z Len", 150, 50, 300, 50 );
SetGapOpenStat( len ); // set global variables Chg_ON, Std_chg_ON, Z_chg_ON
Plot( Chg_ON, "RetON%", colorBlack, styleNoDraw | styleOwnScale );
Plot( Std_chg_ON, "StdRetON", colorBlack, styleNoDraw | styleOwnScale );
Plot( Z_chg_ON, "Z", colorBlue, styleHistogram );
Plot( 1, "+1", colorGreen, styleLine | styleDashed );
Plot( -1, "-1", colorRed, styleLine | styleDashed );