Dukascopy
 
 
Wiki JStore Search Login

BUG: Visual JForex Indicator
 Post subject: BUG: Visual JForex Indicator Post rating: 0   New post Posted: Sat 28 Dec, 2013, 10:52 
User avatar

User rating: 3
Joined: Mon 05 Mar, 2012, 11:15
Posts: 24
Location: Indonesia, Jakarta
This issue is already reported here Something wrong with historical tester


Bug Desciption :
Indicator returning wrong result (affecting all indicator).

Detail:
This is example from my strategy.


/*
 * Created by VisualJForex Generator, version 1.31
 * Date: 28.12.2013 08:18
 */
......
private void CCI_block_17(Integer flow) {
        Instrument argument_1 = defaultInstrument;
        Period argument_2 = cciPeriod;
        int argument_3 = 1;
        int argument_4 = 14;
        OfferSide[] offerside = new OfferSide[1];
        IIndicators.AppliedPrice[] appliedPrice = new IIndicators.AppliedPrice[1];
        offerside[0] = OfferSide.BID;
        appliedPrice[0] = IIndicators.AppliedPrice.TYPICAL_PRICE;
        Object[] params = new Object[1];
        params[0] = 14;
        try {
            subscriptionInstrumentCheck(argument_1);
            long time = context.getHistory().getBar(argument_1, argument_2, OfferSide.BID, argument_3).getTime();
            Object[] indicatorResult = context.getIndicators().calculateIndicator(argument_1, argument_2, offerside,
                    "CCI", appliedPrice, params, Filter.WEEKENDS, argument_3 +1, time, 0);
            if ((new Double(((double [])indicatorResult[0])[0])) == null) {
                this.cci1 = Double.NaN;
            } else {
                this.cci1 = (((double [])indicatorResult[0])[0]);
            }
        } catch (JFException e) {
            e.printStackTrace();
        }
        MultipleAction_block_22(flow);
    }


There is logic error at calculateIndicator()

long time = context.getHistory().getBar(argument_1, argument_2, OfferSide.BID, argument_3).getTime(); // Get start of candle time

Object[] indicatorResult = context.getIndicators().calculateIndicator(argument_1, argument_2, offerside,
"CCI", appliedPrice, params, Filter.WEEKENDS, argument_3 +1, time, 0); // argument_3 should not be there, time parameter already point to correct shift

Argument_3 will double the shift value
Eg. CCI[0] -> CCI[0] // get CCI with shift 0 would return cci with shift 0 , correct but useless
CCI[1] -> CCI[2] // get CCI with shift 1 would return cci with shift 2 , INCORRECT
CCI[n] -> CCI[N*2] // get CCI with shift N would return cci with shift N*2

FIX:
Object[] indicatorResult = context.getIndicators().calculateIndicator(argument_1, argument_2, offerside,
"CCI", appliedPrice, params, Filter.WEEKENDS, 1, time, 0); // without argument_3 parameter

Does dukascopy already acknowledged that bug, since it's has been a month.
Regards


 
 Post subject: Re: BUG: Visual JForex Indicator Post rating: 0   New post Posted: Mon 30 Dec, 2013, 16:59 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
Greetings.

Following bug will be fixed in the closest update of VJfx.

Best regards, Support team.


 

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