Dukascopy
 
 
Wiki JStore Search Login

Strategytester - Period
 Post subject: Strategytester - Period Post rating: 0   New post Posted: Thu 27 Jun, 2013, 19:29 

User rating: 2
Joined: Thu 27 Jun, 2013, 19:14
Posts: 13
Hello community,

I am currently working with the JForex Client to build a strategy.
In the OnBar method I just react to Period.ONE_HOUR and it seems to work if I choose 1 Hour in the strategy tester.
However if I choose Day in the tester, my results are different.
My OnBar() is triggered for every hour each day but at most hours the Open, High, Low and Close values stay the same. It seems that I just get new values at 3am, 9am, 3pm and 9pm.
It confuses a bit, that the values for O,H,L,C are all the same every hour.

Now my question is: Are the results of my strategy with the above explained behaviour just nonsense or is it possible to get my strategy working in real time, exactly the way it does in the tester with period set to Day and in the OnBar just reacting to Period.ONE_HOUR ?

I tried to mimic the behaviour with filtering the hours I open my trades to 3am, 9am, 3pm, 9pm but its not the same but maybe its possible. Maybe the values I get as Period.ONE_HOUR are somehow an average of something and I could do that myself in real time?
I am looking forward for any input and help on this.


Greetings
HansD


 
 Post subject: Re: Strategytester - Period Post rating: 0   New post Posted: Fri 28 Jun, 2013, 09:40 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide an example strategy which demonstrates the problem. Please provide a screenshot of Historical Tester settings that you use.


 
 Post subject: Re: Strategytester - Period Post rating: 0   New post Posted: Fri 28 Jun, 2013, 12:43 

User rating: 2
Joined: Thu 27 Jun, 2013, 19:14
Posts: 13
Hello,

I use the OnBar method and watch for Period.ONE_HOUR to see what the strategy gets:

@Override
    public void onBar(Instrument instrument, Period period, IBar askBar,
            IBar bidBar) throws JFException {


        if (period == Period.ONE_HOUR) {

           
            // print out some information about the current bar we got
            console.getOut().println(bidBar.toString());
           


            // we got a new bar we can evaluate
            double rsiVal = indicators.rsi(instrument, Period.ONE_HOUR, OfferSide.BID,
                    AppliedPrice.CLOSE, 15, 0);

List orders = engine.getOrders();

            if (orders.size() > 0) return; // only 1 trade at a time

// Open trades etc.
// ...                       
     }
}


The thing is, I get only new values 3 (sometimes 4) times a day and I dont know exactly what happens with the calculation of the rsi value if I set the historical tester to Day...
You can see that I get new values at 9am, 3pm and 9pm and I dont know if these values are an average I could reproduce in live-trading or if these values contain information about the future I cant know in live-trading...
In the picture you can see what I get in the OnBar-Method and what Setup I use for the historical tester.

Image


 
 Post subject: Re: Strategytester - Period Post rating: 0   New post Posted: Sat 29 Jun, 2013, 13:24 

User rating: 2
Joined: Thu 27 Jun, 2013, 19:14
Posts: 13
Doesnt anyone have an answer for that or ran into the same problem yet?


 
 Post subject: Re: Strategytester - Period Post rating: 0   New post Posted: Mon 01 Jul, 2013, 07:46 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
1 Day is an optimization method which means that for this particular setting you will get only 4 ticks per day.


 
 Post subject: Re: Strategytester - Period Post rating: 0   New post Posted: Mon 01 Jul, 2013, 13:57 

User rating: 2
Joined: Thu 27 Jun, 2013, 19:14
Posts: 13
Ah ok,

but the question if the 4 ticks per day are useful data is still there.
Lets say I want my strategy to react just like in the historical tester with setup 1 Day and in my OnBar() I just listen to Period.ONE_HOUR which occurs 4 times a day.

Are the 4 ticks an average I can calculate myself in real time?
Or are some of the data kind of "future-data" and I wont be able to calculate them in real-time?

I have another question: When I calculate my indicator in the OnBar() like this:

double rsiVal = indicators.rsi(instrument, Period.ONE_HOUR, OfferSide.BID,
                    AppliedPrice.CLOSE, 15, 0);


Which bars are used for that? Are exactly the same bars used I get in the OnBar() method or is that different data?
That would be neccessary to know to mimic the behaviour.


 
 Post subject: Re: Strategytester - Period Post rating: 0   New post Posted: Wed 03 Jul, 2013, 13:26 

User rating: 2
Joined: Thu 27 Jun, 2013, 19:14
Posts: 13
I would appreciate a response to the question above because its a critical part for my current strategy-development, since the results are heavily determined of the Period I choose for the historical tester. There is such a huge difference of the outcome of my strategy-results, that I know need to know if I can trust the 4 Ticks that I get when choosing 1 Day in the historical tester.


 

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