Hello guys, i am having a little trouble with a very simple snippet.
i am trying to plot dynamic color on a MA from a different timeframe (4 hourly on a 15min chart)
when i plot the expanded MA i get red bits where it should only be white (ive highlighted them in pink in the attached picture.
in the same picture below it is the 4 hourly window of the same code un compressed and shows it all in white.
can anybody help?
the code is as follows
////////////////////////////////////////////////////4 hourly stuff///////
setstime = Param( "Timeset", 4, 1, 24 );
TimeFrameSet (setstime*inHourly);
WMAC4 = WMA( C, 15 );
WMAO4 = WMA( O, 15 );
WMAC14 = Ref(WMA( C, 15 ),-3);
Closeminprevclose4 = WMAc4-WMAC14;
Openminclose4 = WMAO4-WMAC4;
dynamic_color = IIf( Closeminprevclose4>Openminclose4 , colorWhite, colorRed );
Plot(TimeFrameExpand(Closeminprevclose4, setstime*inHourly),"Close - Prev2close", dynamic_color, styleThick, Null, Null, 0 );
Plot(TimeFrameExpand( Openminclose4, setstime*inHourly),"open - close", colorAqua, styleThick, Null, Null, 0 );
TimeFrameRestore();
///////////////////////////
i am trying to plot dynamic color on a MA from a different timeframe (4 hourly on a 15min chart)
when i plot the expanded MA i get red bits where it should only be white (ive highlighted them in pink in the attached picture.
in the same picture below it is the 4 hourly window of the same code un compressed and shows it all in white.
can anybody help?
the code is as follows
////////////////////////////////////////////////////4 hourly stuff///////
setstime = Param( "Timeset", 4, 1, 24 );
TimeFrameSet (setstime*inHourly);
WMAC4 = WMA( C, 15 );
WMAO4 = WMA( O, 15 );
WMAC14 = Ref(WMA( C, 15 ),-3);
Closeminprevclose4 = WMAc4-WMAC14;
Openminclose4 = WMAO4-WMAC4;
dynamic_color = IIf( Closeminprevclose4>Openminclose4 , colorWhite, colorRed );
Plot(TimeFrameExpand(Closeminprevclose4, setstime*inHourly),"Close - Prev2close", dynamic_color, styleThick, Null, Null, 0 );
Plot(TimeFrameExpand( Openminclose4, setstime*inHourly),"open - close", colorAqua, styleThick, Null, Null, 0 );
TimeFrameRestore();
///////////////////////////
Attachments
-
17.2 KB Views: 89
-
99.3 KB Views: 91