Spenquatch
New member
- Joined
- Dec 19, 2022
- Posts
- 2
- Likes
- 0
Hello! I am coming from EasyLanguage and have an issue translating my indicators over to MW. This seems extremely basic, but I am new to Java so please bear with me! For the life of me, I cannot get the value of a variable I have set up from the previous bar (I can get the previous bar OHLC using series.getClose(index), but not custom variables). I have looked at a bunch of the other indicators to see how they do it, but it just doesn't seem to work for me. This is what I believe should work, but does not:
Eclipse compiles fine, but all plot values disappear from MW when this code is added, but the study stays active on the chart.
Any help would be greatly appreciated!
I am translating Ehlers Even Better Sinewave Indicator. I will share once I get it completed!
Java:
double prevHP = series.getDouble(index-1, Values.HP);
double _HP = 0.5 * (1 + alpha1) * (currentClose - prevClose) + alpha1 * prevHP;
series.setDouble(index, Values.HP, _HP);
Eclipse compiles fine, but all plot values disappear from MW when this code is added, but the study stays active on the chart.
Any help would be greatly appreciated!
I am translating Ehlers Even Better Sinewave Indicator. I will share once I get it completed!