Dukascopy
 
 
Wiki JStore Search Login

Balance of Power (BOP) - Shift 0 does not return right value
 Post subject: Balance of Power (BOP) - Shift 0 does not return right value Post rating: 0   New post Posted: Mon 08 Oct, 2012, 09:46 

User rating: 0
Joined: Mon 17 Sep, 2012, 14:05
Posts: 25
Unfortunately, using shift 0 with the BOP indicator the historical tester always returns the value 0.0.

Extract of the code:

Global variables:

private Instrument currency = Instrument.GBPUSD;

private Period bobPeriod = Period.ONE_HOUR;
private Integer bobShift = 0;

Methods:

public double getBopLong() {
double bop = -1;
try {
bop = indicators.bop(currency, bobPeriod, OfferSide.BID, bobShift);
} catch (Exception e) {
console.getErr().print(e.getMessage());
}
return bop;
}


public double getBopShort() {
double bop = -1;
try {
bop = indicators.bop(currency, bobPeriod, OfferSide.ASK, bobShift);
} catch (Exception e) {
console.getErr().print(e.getMessage());
}
return bop;
}

Shift 1 works fine!


 
 Post subject: Re: Balance of Power (BOP) - Shift 0 does not return right value Post rating: 0   New post Posted: Tue 09 Oct, 2012, 15:08 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
API 2.7.5


 
 Post subject: Re: Balance of Power (BOP) - Shift 0 does not return right value Post rating: 0   New post Posted: Wed 10 Oct, 2012, 12:42 

User rating: 0
Joined: Mon 17 Sep, 2012, 14:05
Posts: 25
Thanks but what is meant by this answer?

Either see API 2.7.5 or wait for API 2.7.5 (?) because the only version I can find is 2.7.4!
If there's V2.7.5 already available, please provide a link.

Thank you very much.


 

Jump to:  

  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com