Stackoverflow on setBarColor

Hari

Member
Joined
Jan 15, 2025
Posts
5
Likes
2
I'm new to Motivewave. I'm trying to get a simple custom study to work. When I look at the logs, I see it is throwing a stackoverflow exception. I'm using a community edition JDK 23.01 and use the same JDK version for development as well.

Can someone help please?

package study_examples;

import com.motivewave.platform.sdk.common.DataContext;
import com.motivewave.platform.sdk.common.DataSeries;
import com.motivewave.platform.sdk.common.Defaults;
import com.motivewave.platform.sdk.common.desc.ColorDescriptor;
import com.motivewave.platform.sdk.study.Study;
import com.motivewave.platform.sdk.study.StudyHeader;

import java.awt.*;


@StudyHeader(
namespace = "com.motivewave.hsa.strategies",
overlay = true,
name = "OHLC Study",
id= "OHLC Study",
menu = "MyMotivewave",
desc = "Gets OHLC data",
supportsBarUpdates = true,
requiresBarUpdates = true
)
public class OHLC extends Study {
@Override
public void initialize(Defaults defaults){
var sd = createSD();
var tab =sd.addTab("General");
var group = tab.addGroup("Colors");
group.addRow(new ColorDescriptor("Color", "Color", new Color(255,255,255)));
sd.addQuickSettings("Color");

}


@Override
public void calculate(int index, DataContext ctx){
if (index < 0) return;

DataSeries series = ctx.getDataSeries();
// Force EVERY bar to be red
series.setBarColor(index, Color.RED);
}
}
 
This is because my eclipse setup was messed up. I just removed and reinstalled.
 
Top