Dukascopy
 
 
Wiki JStore Search Login

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

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

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

Code is not making any trade in history tester.
 Post subject: Code is not making any trade in history tester. Post rating: 0   New post Posted: Mon 01 Aug, 2011, 04:47 

User rating: -
I want to run a my strategy on EURUSD M15 chart.

I used below code:

@Override
        public void onStart(IContext context) throws JFException {

            Set subscribedInstruments = new HashSet();
            subscribedInstruments.add(Instrument.EURUSD);
            context.setSubscribedInstruments(subscribedInstruments);

        }


@Override 
        public void onBar(Instrument instrument, Period period, IBar askBar,
                IBar bidBar) throws JFException {
            //first line
            if (instrument != Instrument.EURUSD || period != Period.FIFTEEN_MINS) return;
        }


But this code is not making any trade in history tester.

Also, I see my strategy status as pending.

How can I fix this?


 
 Post subject: Re: Code is not making any trade in history tester. Post rating: 0   New post Posted: Tue 02 Aug, 2011, 08:44 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
I have tested that onBar method in historical tester receives bars with Period.FIFTEEN_MINS.

You may also check whether there are any messages being printed on java console. Java console can be turned on as described here.


 

Jump to:  

  © 1998-2025 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