Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

four hour problem
 Post subject: four hour problem Post rating: 0   New post Posted: Mon 27 Jul, 2015, 07:08 
User avatar

User rating: 2
Joined: Sat 02 May, 2015, 20:20
Posts: 20
Location: Ukraine, Kyiv
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


 
 Post subject: Re: four hour problem Post rating: 0   New post Posted: Wed 29 Jul, 2015, 11:07 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Could you provide mt4 code so that we could convert it to java for you?


 
 Post subject: Re: four hour problem Post rating: 0   New post Posted: Tue 04 Aug, 2015, 19:21 
User avatar

User rating: 2
Joined: Sat 02 May, 2015, 20:20
Posts: 20
Location: Ukraine, Kyiv
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


 
 Post subject: Re: four hour problem Post rating: 0   New post Posted: Wed 05 Aug, 2015, 09:39 
User avatar

User rating: 2
Joined: Sat 02 May, 2015, 20:20
Posts: 20
Location: Ukraine, Kyiv
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.


 
 Post subject: Re: four hour problem Post rating: 0   New post Posted: Tue 11 Aug, 2015, 15:00 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Code sample is too small. Please send full strategy.


 

Jump to:  

cron
  © 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