onBarUpdate() and onTick() not getting called

jwilliams9090

Member
Joined
Feb 4, 2024
Posts
8
Likes
1
I started with the TrendLine.java example. The onBarClose() override callback is working fine, I've added code there and that is being called when a bar closes. I've added code to onBarUpdate() and onTick() (that code being debug() for now) but it's never called, not showing up in the Study Log like the print outs I added to onBarClose(). I did the same thing in onBarClose() and it works. Anyone ran into this? Kind of weird. Not sure if maybe those calls are just not supported any more or what the problem could be. When I build in Eclipse I right click on build.xml and select Run As->Ant Build.
 
Thanks! That's it. I am using the examples in the studies and I started with Trend Line and Moving Average, there is also a Options tab on the study to set it if a person wants to do it manually. The thing I encountered that had me banging my head is the change did not take place immediately. I checked the checkbox in the Options Tab and I also updated the study header but it didn't work. But the next day it was. So there was some kind of cacheing going on, or something. That was kind of frustrating but it's working now. Thanks again for the response.
 
How to works OnTick()? I have this code and Doesn't works info()

import com.motivewave.platform.sdk.common.*;
import com.motivewave.platform.sdk.common.Tick;
import com.motivewave.platform.sdk.common.TickOperation;
import com.motivewave.platform.sdk.study.Study;
import com.motivewave.platform.sdk.study.StudyHeader;

/** Terminal */
@StudyHeader(
namespace="com.motivewave",
id="TERMINAL",
rb="com.motivewave.platform.study.nls.strings",
name="TERMINAL",
menu="LAB",
desc="TERMINAL",
label="TERMINAL",
overlay=true)
public class Terminal extends Study
{
// final static String MULTIPLIER = "multiplier";
// enum Values { TOP, BOTTOM }

@Override
public void initialize(Defaults defaults)
{
this.info("initialize");
var sd = createSD();
var tab = sd.addTab(get("TAB_GENERAL"));
}

@Override
public void onTick(DataContext ctx, Tick tick)
{
this.info("onTick");
}

}
 
You need to make sure this is on or checked: requiresBarUpdates. In the TrendLines example I did it like this:
@StudyHeader(
namespace="com.motivewave",
id="TREND_LINE_EXAMPLE"
+ "",
name="Trend Line",
desc="This is an example study that draws a simple trend line and allows the user to resize it",
menu="Examples3",
requiresBarUpdates=true,
overlay=true)
 
Top