Hello All
I was trying to make value charts as in "Mark helweg Value Chart" but constantly getting syntax error.
I am trying to change value of the same bar when it crosses 4 or 8 to yellow and Red respectively.
can anyone help me with this charting.
greatly appreciate
regards
Formula=======
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlue ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
numbars = LastValue(Cum(Status("barvisible")));
fraction= IIf(StrRight(Name(),3) == "",3.2,3.2);
hts = Param ("Text Shift", -50,-100,100,10);
PlotText("RSI(14) >> " + WriteVal(RSI(14),fraction),
SelectedValue(BarIndex()+1)-(numbars/hts),SelectedValue(C),colorWhite);
//// Vchart
//This was converted from code created for TradeStation by Mark W. Helweg of ValueCharts.com
VarNumbars = Param("Number of bars",5,2,1000,1);
Color = Param("Bar Color",colorBlue);
Top = Param("Top bar Color",8); ParamColor("Bar color",colorRed);
TopMid = Param("Top Mid Bar Color",4); ParamColor("Bar color",colorYellow);
BottomMid = Param("Bottom Mid Bar Color",-4); ParamColor("Bar color",colorYellow);
Bottom = Param("Bottom Bar Color",-8); ParamColor("Bar color",colorRed);
Plot(Top,"Top Bar",colorRed); IIf(ValueWhen() (>="8", 1, 0));
Plot(TopMid,"Top Mid Bar",colorYellow); IIf(ValueWhen>=4, <=7.99, 0);
Plot(BottomMid,"Bottom Mid bar",colorYellow); IIf(ValueWhen<=-4, >=-7.99, 0);
Plot(Bottom,"Bottom Chart Line",colorRed); IIf(ValueWhen<=-8, 1, 0) ;
LRange = 0;
VarP = round(VarNumBars/5);
if (VarNumBars > 7)
{
VarA=HHV(H,VarP)-LLV(L,VarP);
VarR1 = IIf(VarA==0 AND VarP==1,abs(C-Ref(C,-Varp)),VarA);
VarB=Ref(HHV(H,VarP),-VarP+1)-Ref(LLV(L,VarP),-VarP);
VarR2 = IIf(VarB==0 AND VARP==1,abs( Ref(C,-VarP)-Ref(C,-Varp*2) ),VarB);
VarC=Ref(HHV(H,VarP),-VarP*2)-Ref(LLV(L,VarP),-VarP*2);
VarR3 = IIf(VarC == 0 AND VarP==1,abs(Ref(C,-Varp*2)-Ref(C,-Varp*3)),VarC);
VarD = Ref(HHV(H,VarP),-VarP*3)-Ref(LLV(L,VarP),-VarP*3);
VarR4 = IIf(VarD == 0 AND VarP==1,abs(Ref(C,-Varp*3)-Ref(C,-Varp*4)),VarD);
VarE = Ref(HHV(H,VarP),-VarP*4)-Ref(LLV(L,VarP),-VarP*4);
VarR5 = IIf(VarE == 0 AND VarP==1,abs(Ref(C,-Varp*4)-Ref(C,-Varp*5)),VarE);
LRange=((VarR1+VarR2+VarR3+VarR4+VarR5)/5)*.2;
};
CDelta = abs(C - Ref(C,-1));
if (VarNumBars <=7)
{
Var0 = IIf(CDelta > (H-L) OR H==L,CDelta,(H-L));
LRange = MA(Var0,5)*.2;
}
MidBarAverage = MA( (H+L)/2,VarNumbars);
VOpen = (Open- MidBarAverage)/LRange;
VHigh = (High-MidBarAverage)/LRange;
VLow = (Low-MidBarAverage)/LRange;
VClose = (Close-MidBarAverage)/LRange;
PlotOHLC(VOpen,VHigh,VLow,VClose,"ValueChart",color,styleBar| styleNoTitle ,-12,12);
Title= Name() + " " + WriteVal( DateTime(), formatDateTime )+
"\nVOpen " + VOpen + "\n"+ " VHigh "+ VHigh + "\n"+ " VLow " + Vlow + "\n"+ " VClose " + VClose;
Filter = Volume > 50000;
AddColumn( VOpen, "VOpen");
AddColumn( VHigh, "VHigh");
AddColumn( VLow, "VLow");
AddColumn( VClose, "VClose");
_SECTION_END();
_SECTION_END();
_SECTION_BEGIN("Volume");
Color = ParamColor("Color", ColorRGB( 128, 128, 192 ) );
Plot( Volume, _DEFAULT_NAME(), IIf( C > O, ParamColor("Up Color", colorGreen ), ParamColor("Down Color", colorRed ) ), ParamStyle( "Style", styleHistogram | styleOwnScale | styleNoLabel, maskHistogram ), 2 );
_SECTION_END();
=============
Arguments in these lines have to be modified
Plot(Top,"Top Bar",colorRed); IIf(ValueWhen() (>="8", 1, 0));
Plot(TopMid,"Top Mid Bar",colorYellow); IIf(ValueWhen>=4, <=7.99, 0);
Plot(BottomMid,"Bottom Mid bar",colorYellow); IIf(ValueWhen<=-4, >=-7.99, 0);
Plot(Bottom,"Bottom Chart Line",colorRed); IIf(ValueWhen<=-8, 1, 0) ;
I was trying to make value charts as in "Mark helweg Value Chart" but constantly getting syntax error.
I am trying to change value of the same bar when it crosses 4 or 8 to yellow and Red respectively.
can anyone help me with this charting.
greatly appreciate
regards
Formula=======
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlue ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
numbars = LastValue(Cum(Status("barvisible")));
fraction= IIf(StrRight(Name(),3) == "",3.2,3.2);
hts = Param ("Text Shift", -50,-100,100,10);
PlotText("RSI(14) >> " + WriteVal(RSI(14),fraction),
SelectedValue(BarIndex()+1)-(numbars/hts),SelectedValue(C),colorWhite);
//// Vchart
//This was converted from code created for TradeStation by Mark W. Helweg of ValueCharts.com
VarNumbars = Param("Number of bars",5,2,1000,1);
Color = Param("Bar Color",colorBlue);
Top = Param("Top bar Color",8); ParamColor("Bar color",colorRed);
TopMid = Param("Top Mid Bar Color",4); ParamColor("Bar color",colorYellow);
BottomMid = Param("Bottom Mid Bar Color",-4); ParamColor("Bar color",colorYellow);
Bottom = Param("Bottom Bar Color",-8); ParamColor("Bar color",colorRed);
Plot(Top,"Top Bar",colorRed); IIf(ValueWhen() (>="8", 1, 0));
Plot(TopMid,"Top Mid Bar",colorYellow); IIf(ValueWhen>=4, <=7.99, 0);
Plot(BottomMid,"Bottom Mid bar",colorYellow); IIf(ValueWhen<=-4, >=-7.99, 0);
Plot(Bottom,"Bottom Chart Line",colorRed); IIf(ValueWhen<=-8, 1, 0) ;
LRange = 0;
VarP = round(VarNumBars/5);
if (VarNumBars > 7)
{
VarA=HHV(H,VarP)-LLV(L,VarP);
VarR1 = IIf(VarA==0 AND VarP==1,abs(C-Ref(C,-Varp)),VarA);
VarB=Ref(HHV(H,VarP),-VarP+1)-Ref(LLV(L,VarP),-VarP);
VarR2 = IIf(VarB==0 AND VARP==1,abs( Ref(C,-VarP)-Ref(C,-Varp*2) ),VarB);
VarC=Ref(HHV(H,VarP),-VarP*2)-Ref(LLV(L,VarP),-VarP*2);
VarR3 = IIf(VarC == 0 AND VarP==1,abs(Ref(C,-Varp*2)-Ref(C,-Varp*3)),VarC);
VarD = Ref(HHV(H,VarP),-VarP*3)-Ref(LLV(L,VarP),-VarP*3);
VarR4 = IIf(VarD == 0 AND VarP==1,abs(Ref(C,-Varp*3)-Ref(C,-Varp*4)),VarD);
VarE = Ref(HHV(H,VarP),-VarP*4)-Ref(LLV(L,VarP),-VarP*4);
VarR5 = IIf(VarE == 0 AND VarP==1,abs(Ref(C,-Varp*4)-Ref(C,-Varp*5)),VarE);
LRange=((VarR1+VarR2+VarR3+VarR4+VarR5)/5)*.2;
};
CDelta = abs(C - Ref(C,-1));
if (VarNumBars <=7)
{
Var0 = IIf(CDelta > (H-L) OR H==L,CDelta,(H-L));
LRange = MA(Var0,5)*.2;
}
MidBarAverage = MA( (H+L)/2,VarNumbars);
VOpen = (Open- MidBarAverage)/LRange;
VHigh = (High-MidBarAverage)/LRange;
VLow = (Low-MidBarAverage)/LRange;
VClose = (Close-MidBarAverage)/LRange;
PlotOHLC(VOpen,VHigh,VLow,VClose,"ValueChart",color,styleBar| styleNoTitle ,-12,12);
Title= Name() + " " + WriteVal( DateTime(), formatDateTime )+
"\nVOpen " + VOpen + "\n"+ " VHigh "+ VHigh + "\n"+ " VLow " + Vlow + "\n"+ " VClose " + VClose;
Filter = Volume > 50000;
AddColumn( VOpen, "VOpen");
AddColumn( VHigh, "VHigh");
AddColumn( VLow, "VLow");
AddColumn( VClose, "VClose");
_SECTION_END();
_SECTION_END();
_SECTION_BEGIN("Volume");
Color = ParamColor("Color", ColorRGB( 128, 128, 192 ) );
Plot( Volume, _DEFAULT_NAME(), IIf( C > O, ParamColor("Up Color", colorGreen ), ParamColor("Down Color", colorRed ) ), ParamStyle( "Style", styleHistogram | styleOwnScale | styleNoLabel, maskHistogram ), 2 );
_SECTION_END();
=============
Arguments in these lines have to be modified
Plot(Top,"Top Bar",colorRed); IIf(ValueWhen() (>="8", 1, 0));
Plot(TopMid,"Top Mid Bar",colorYellow); IIf(ValueWhen>=4, <=7.99, 0);
Plot(BottomMid,"Bottom Mid bar",colorYellow); IIf(ValueWhen<=-4, >=-7.99, 0);
Plot(Bottom,"Bottom Chart Line",colorRed); IIf(ValueWhen<=-8, 1, 0) ;