bysoaa
February 9, 2022, 11:40am
1
With this formula and results in explore:
S = colorYellow;
S[BarCount - 1] = colorGreen;
S[BarCount - 2] = colorRed;
S[BarCount - 3] = colorGreen;
PlotOHLC( 1, 1, 0, 0, "", S, styleCloud );
AddColumn( BarIndex(), "BarIndex", 1 );
AddColumn( BarCount, "BarCount", 1 );
AddColumn( S, "S", 1 );
Filter = 1;
I expect this result:
But I get this one:
Any clue?
This is the code for plotting the first image:
S = colorYellow;
S[BarCount - 2] = colorGreen;
S[BarCount - 3] = colorRed;
S[BarCount - 4] = colorGreen;
PlotOHLC( 1, 1, 0, 0, "", S, styleCloud );
v6.40.4
Tomasz
February 9, 2022, 12:49pm
2
In styleCloud, the color[0] is used to paint area between bar 0 and 1 , color[1] is used to paint area between bar 1 and 2 , and so on, so color[ BarCount -2 ]
is used to paint space between bars with indices BarCount-2
and BarCount-1
. There is no next bar after BarCount-1 so such color is not used.
To achieve what you want use this code:
S = colorYellow;
S[BarCount - 1] = colorGreen;
S[BarCount - 2] = colorRed;
S[BarCount - 3] = colorGreen;
Plot( 1, "", S, styleArea | styleOwnScale, 0, 1 );
2 Likes
system
Closed
May 20, 2022, 12:50pm
3
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.