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 does method startStrategy from IStrategies work?
 Post subject: How does method startStrategy from IStrategies work? Post rating: 0   New post Posted: Thu 30 Aug, 2012, 17:27 
User avatar

User rating: 1
Joined: Tue 01 May, 2012, 22:05
Posts: 17
Location: United Kingdom, London
I want to open a new strategy inside another strategy based upon the outcome of that strategy.
So I wrote inside an If statement :

File file = new File("C:/Users/Documents/JForex/Strategies/Files/Strategy1.jfx");
IStrategyListener listener = new IStrategyListener() {public void onStart(long strategyId){} public void onStop(long strategyId){}};
Map paraMap = new HashMap();
paraMap.put("Instrument", selectedInstrument);
strategy.startStrategy(file, listener, paraMap, true);

The strategy compiled without errors, but when the method startStrategy is called it throws a nullpointerexception.
I think this has something to do with the file.

I could just copy past the whole strategy into the other so it becomes 1 very large one. Does anybody know what I could do?


 
 Post subject: Re: How does method startStrategy from IStrategies work? Post rating: 0   New post Posted: Fri 31 Aug, 2012, 08:58 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
To execute a strategy logic of another strategy consider from JForex plaform, consider the following approach:
https://www.dukascopy.com/wiki/#Multiple_strategies_within_a_strategy
To run multiple strategies from JForex SDK, consider the following approach:
https://www.dukascopy.com/wiki/#JForex_SDK/Running_strategies


 

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