The Translator incorrectly translated the following code, but it runs OK:
public int RSIPane = 0;
RSIPane = (int)CreatePane(50, true, true);
PlotSeries(RSISeries(WL_CLOSE, 14), RSIPane, WL_BLUE, WL_THIN);
DrawText("RSI(14)", RSIPane, 5, 3, WL_BLUE, 9);
DrawLine(LastPeakBarNew, RSIHigh, j, RSIHigh, RSIPane, WL_BLACK, WL_THIN);
DrawLine((Bars.Count - 10), (RSIHigh - RSIHighMinusTrig), j, (RSIHigh - RSIHighMinusTrig), RSIPane, WL_BLACK, WL_DOTTED);
When I try to change it to standard WL5.5 syntax, I get errors:
public /** declare RSI pane */
int RSIPane = 0;
RSIPane = (int)CreatePane(50, true, true);
PlotSeries(RSIPane, RSISeries(Close, 14), Color.Blue, WealthLab.LineStyle.Solid,(int)1);
DrawText(RSIPane, "RSI(14)", 5, 3, Color.Blue);
DrawLine(RSIPane, LastPeakBarNew, (double)RSIHigh, j-1, (double)RSIHigh, Color.Black, WealthLab.LineStyle.Dotted, 1);
DrawLine(RSIPane, (Bars.Count - 10), (double)(RSIHigh + RSIHighMinusTrig), j-1, (double)(RSIHigh + RSIHighMinusTrig), Color.Black, WealthLab.LineStyle.Dotted, 1);
With this, I get the same error with every line that references 'RSIPane'. An example is the following:
error CS1503 @ (130,14): Argument '1': cannot convert from 'int' to 'WealthLab.ChartPane'
Size:
Color:
CODE:
Please log in to see this code.
The key is to define
RSIPane as a
ChartPane, not integer. Please see the QuickRef for
CreatePane.
Size:
Color:
I made the changes that you suggested, so that now I have:
127 ChartPane RSIPane = CreatePane(50, true, true);
128 PlotSeries(RSIPane, RSI.Series(Close, 14), Color.Blue, WealthLab.LineStyle.Solid, 1);
When I compile, I get the following errors:
error CS0029 @ (127,25):Cannot implicitly convert type 'int' to 'WealthLab.ChartPane'
error CS0119 @ (128,25):'finatic.TL.WealthScriptTL.RSI(int,int,int)' is a 'method', which is not valid in the given context
Size:
Color:
You said you're trying to change to standard WL5.5 syntax. Looks like there's WSTL syntax all over, and it overrides Wealth-Lab's types e.g. ChartPane with its own. Mixing WSTL and standard syntaxes will create confusion, so you need to either get rid of WSTL's contructs or move the native code snippets to a new Strategy window.
Size:
Color:
Will there be another version of the Translator available soon that will correctly translate everything from WL4.5 to WL5.x?
How long do I have before WL4.5 is decommissioned?
Size:
Color: