I am trying to use the .tag option in the Position Sizing Options.
I want to use different risk percentages on different markets.
First I established a variable for the first two letters of the symbol:
CODE:
Please log in to see this code.
Then I attempted to copy and paste the code from the WL Wiki after my signal instructions:
CODE:
Please log in to see this code.
I get the error: CS0117 @ 159, 19 ‘int’ does not contain a definition for ‘Tag’
Any help greatly appreciated.
Size:
Color:
In this context, the only reason for this odd error message is trying to mix code generated by WealthScript Translator (WSTL) with pure WealthScript, or editing WSTL code. This is not going to work. Mixing WSTL output with WealthScript is not endorsed/supported.
P.S. Not sure if having two topics on using .Tag in Position Options makes the forum better, but since we have it, here's a related topic:
Use Tag in Position Options
Size:
Color:
P.S. Just to clarify, in plain English:
For the benefit of legacy users migrating from WL4 to WL5, the WSTL designers maintained types between the platforms as closely as possible.
WSTL output requires the WealthScript Translator library to run. Although it looks like WealthScript, it's NOT.
In WSTL, a Position object (e.g. LastPosition) is of type integer. In C#, integer numbers do not have a .Tag.
That's why playing with WSTL output is doomed to fail.
Size:
Color:
Thank you for the clarification. I will attempt to rewrite my code from scratch and then try the TAG code.
Size:
Color: