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.

How do you pass parameters to a strategy?
 Post subject: How do you pass parameters to a strategy? Post rating: 0   New post Posted: Sun 08 Aug, 2010, 04:53 

User rating: 0
Joined: Wed 21 Jul, 2010, 00:47
Posts: 4
For example I would like to be able to change the price every time I run a strategy.

I have noticed that when you right click on a strategy to run it, there is an option called "parameters". This is currently greyed out on my options.

How do i change my code to allow me to pass a strategy a parameter. I have tried the following which doesn't work :)

public class ParameterTest(double dPrice) implements IStrategy {

public void onTick(Instrument instrument, ITick tick) throws JFException {
console.getOut().println(dPrice);
}

}

Thanks in advance.


 
 Post subject: Re: How do you pass parameters to a strategy? Post rating: 0   New post Posted: Sun 08 Aug, 2010, 05:02 

User rating: 0
Joined: Wed 21 Jul, 2010, 00:47
Posts: 4
Solved it.

@Configurable("") public int [variable]=[value];

Thanks


 

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