xel_arjona
Member
- Joined
- Oct 15, 2024
- Posts
- 7
- Likes
- 1
Good Day guys, Im learning MW's SDK and in the run trying to port one of my more used studies from TradingView, but Im some kind slowed down with the correct method to define own enumerators with Strings to be used as "Options" by my study. This is what I want to be done, my base "template" was the BollingerBands and other indicators as the FRAMA from the Source Code Studies published in this forum from 2019:
First Im declaring the contents in the enumerator as Strings:
Then the enumerator:
At the initialize section, Im using the enum as follow, please correct me if this is wrong or I must use other inputDescriptor method:
Then at the calculate section, Im trying to call my "selection" with:
Then, "ant" returns me their angry as:
My Code is MIT open at TradingView, so feel free to see my attempt at the original attached source for MotiveWave:
Hope you can help me guys, I want to port other things to this wonderfull platform!
Cheers!
First Im declaring the contents in the enumerator as Strings:
final static String COMPOSITE = "RangeVolumeComposite", RANGE = "Range", VOLUME = "Volume";
Then the enumerator:
enum CoeffType { COMPOSITE, RANGE, VOLUME }
At the initialize section, Im using the enum as follow, please correct me if this is wrong or I must use other inputDescriptor method:
inputs.addRow(new InputDescriptor(COEFF_MODE, "Weighing Factor Mode:", CoeffType.COMPOSITE));
Then at the calculate section, Im trying to call my "selection" with:
var coeffType = getSettings().getEnum(COEFF_MODE, CoeffType.COMPOSITE);
Then, "ant" returns me their angry as:
error: method getEnum in class Settings cannot be applied to given types;
[javac] var coeffType = getSettings().getEnum(COEFF_MODE, CoeffType.COMPOSITE);
[javac] ^
[javac] required: String
[javac] found: String,CoeffType
[javac] reason: cannot infer type-variable(s) T
[javac] (actual and formal argument lists differ in length)
[javac] where T is a type-variable:
[javac] T extends Object declared in method <T>getEnum(String)
My Code is MIT open at TradingView, so feel free to see my attempt at the original attached source for MotiveWave:
Hope you can help me guys, I want to port other things to this wonderfull platform!
Cheers!