I've inserted 2 data:
- data1 (300 contract bar)
- data2 - Hidden (3000 contract bar)
I'd like that MC plots the bars of data1 based on the study of data2.
The study is a simple macd.
Here is the code:
Code: Select all
inputs: FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ), UpTrend(cyan), DownTrend(magenta) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ), color(0) ;
value1 = close of data2;
var0 = MACD( value1, FastLength, SlowLength ) ;
var1 = XAverage( var0, MACDLength ) ;
var2 = var0 - var1 ;
If var2 > 0 then color = UpTrend;
If var2 < 0 then color = DownTRend;
if Var2 > 0 then begin
PlotPaintbar(H,L,O,C, "Uptrend", color);
end else begin
PlotPaintbar(H,L,O,C, "DownTrend", color);
END;
It paints bars as the study is based on a simple macd of data1.
If I change the properties and apply the study on data2, it plots correctly, but not each bar of data1 (second image)