Building Value Chart problem
1 replies
Aj
2 years ago #276546
Hi all,
I am trying to build a Value Chart on Code Editor and I am having problem to call an average function to build this:
Var:
Rel(0), Vol(0);
rel = average((H+L)/2, Period);
vol = average((H-L), Period);
ValueOpen = (open – rel / (vol * 1/period)
I did this
@Override
protected void OnBarUpdate() throws TradingException {
double HL = 0;
double HL2 = 0;
double rel = 0;
double vol = 0;
if (CurrentBar < Period) {
Value.set(0, 0);
HL = Input.High.get(0) – Input.Low.get(0);
HL2 = (Input.High.get(0) + Input.Low.get(0))/2;
Relative.onBarUpdate(0, CurrentBar);
Volat.onBarUpdate(0, CurrentBar);
return;
}
Relative.onBarUpdate(HL2, CurrentBar);
Volat.onBarUpdate(HL, CurrentBar);
// DeMinAverageCalculator.onBarUpdate(Math.max(Chart.Low(1) – Chart.Low(0), 0), CurrentBar);
double Rel = Realtive.getValue();
double Vol = Realtive.getValue();
double VO = (Input.Open.get(0) – Rel / (Vol * 1/Period) );
Value.set (0, VO);
and nothing happened
I’d appreciate some help on it
tomas262
2 years ago #276733
This does not seems to be complete code. If you send us the complete code to [email protected] we could check more
Viewing 1 replies (of 1 total)