Dukascopy
 
 
Wiki JStore Search Login

请问怎样限制计算BAR时间范围(如一天,二天)
 Post subject: 请问怎样限制计算BAR时间范围(如一天,二天) Post rating: 0   New post Posted: Thu 12 Jan, 2017, 04:01 

User rating: 0
Joined: Mon 25 Jan, 2016, 05:59
Posts: 14
Location: China,
如题 请求帮助 谢谢
  private int period = 0;       // default = DAILY   
  private int lookback = 2;   //   DAILY *2


public IndicatorResult calculate(int startIndex, int endIndex) {

int inputLength = inputs[1].length - 1; 
        if (  inputLength < lookback || startIndex > endIndex ||
              calculationTimeframe.getPeriod().isSmallerThan(displayTimeframe.getPeriod()) )
          {
              new IndicatorResult(0, 0);
          } 
       
        int lastBar = -1;
        if (inputs[1].length > lookback)
        {
           lastBar = getTimeIndex(inputs[1][inputs[1].length - lookback].getTime(), inputs[0]);
        }
        if (lastBar == -1)
        {
              new IndicatorResult(0, 0);
          }     
 
 if (startIndex != endIndex) {
            highest = 0.0;
            lowest = 0.0;
}

//这里想要指标起始时间从以前一天或二天到现在最新BAR数来运算。
for ( i = inputs[0].length-1,j=0; i > lastBar; i--,j--) {

double todayHigh = inputs[0][i].getHigh();
double todayLow = inputs[0][i].getLow();
  ....
  ....
outputs[0][j] = Double.parseDouble();
        }
       
 return new IndicatorResult(startIndex, j);   
}


 
 Post subject: Re: 请问怎样限制计算BAR时间范围(如一天,二天) Post rating: 0   New post Posted: Tue 17 Jan, 2017, 01:40 

User rating: 0
Joined: Mon 25 Jan, 2016, 05:59
Posts: 14
Location: China,
怎样限定时间开始计算(如每天00:00到23:00;或者每周一到周末)到最新BAR并在图表上画出自定义的指标线


 
 Post subject: Re: 请问怎样限制计算BAR时间范围(如一天,二天) Post rating: 0   New post Posted: Wed 31 May, 2017, 07:43 
Visual JForex expert at Dukascopy

User rating: 1
Joined: Fri 28 Aug, 2015, 09:49
Posts: 53
Location: China, Shanghai
您好,

您可以将这一问题通过邮件反馈到[email protected]

会有相关的技术人员跟进的。

感谢您的配合。

祝好,

Kelvin Zhang


 

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