Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

four hour problem
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=16&t=52968
Page 1 of 1

Author:  tradingbigboy [ Mon 27 Jul, 2015, 07:08 ]
Post subject:  four hour problem

getting the period from the context on the 4 hour produces this error.
 public String convertPeriod(Period timeframe) {
        console.getOut().println("timeframe passed = "+ timeframe+" "+timeframe.name());


The period.name is null.

This produces the following bug
"06:05:41 timeframe passed = 4 Hours null" So if one is trying to key off this and test for period of chart indicator is attached to for instance, it fails.

TBB

Author:  API Support [ Wed 29 Jul, 2015, 11:07 ]
Post subject:  Re: four hour problem

Could you provide mt4 code so that we could convert it to java for you?

Author:  tradingbigboy [ Tue 04 Aug, 2015, 19:21 ]
Post subject:  Re: four hour problem

Simple code here...
public String convertPeriod(Period timeframe) {
        String rc = null;
        if (period == Period.ONE_MIN) rc = "1";
        if (period == Period.FIVE_MINS) rc = "5";
        if (period == Period.FIFTEEN_MINS) rc = "15";
        if (period == Period.THIRTY_MINS) rc = "30";
        if (period == Period.ONE_HOUR) rc = "60";
        if (period == Period.FOUR_HOURS) rc = "240";
        if (period == Period.DAILY) rc = "1440";
        if (period == Period.WEEKLY) rc = "10080";
        if (period == Period.MONTHLY) rc = "43200";
        return (rc);
    }

thanks
TBB

Author:  tradingbigboy [ Wed 05 Aug, 2015, 09:39 ]
Post subject:  Re: four hour problem

So it sees it is the 4 hour period correctly, but the name is null. Looks like a bug to me... So rc remains null and null is returned instead of 240.

Author:  API Support [ Tue 11 Aug, 2015, 15:00 ]
Post subject:  Re: four hour problem

Code sample is too small. Please send full strategy.

  Page 1 of 1