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.

Running multiple strategies with same currency pair trade each
 Post subject: Running multiple strategies with same currency pair trade each Post rating: 0   New post Posted: Fri 06 Jul, 2012, 12:22 

User rating: 0
Joined: Tue 20 Mar, 2012, 12:49
Posts: 7
Location: Greece, Athens
To Dukascopy Jforex support,

I have attached a simple RSI strategy which takes a buy trade or a sell trade depending on whether the market crosses a defined RSI level. It takes only one trade at a time and generates a unique label which is attached to each trade.

If I try to run another strategy simultaneously involving the same currency pair but different time frame, there is an error message displayed that says -

Label not unique (Order already exists)

I request you to modify the strategy so that it allows other strategies to run simultaneously involving the same currency pair. Also, the strategy should still take only one trade at a time.

I suggest adding a label panel in the strategy which can be manually set every time a new strategy is run.

For example, if I run one strategy, I should manually be able to set "1" in the label panel and this number would be unique to all the trades executed by that strategy. If I run another strategy simultaneously involving the same currency pair, I should manually be able to set "2" in the label panel and this number would be unique to all the trades executed by that strategy.

This way each strategy would take up only one trade at a time, each of which would have a different label even though they involve same currency pair.

Many thanks in advance.. :)


Attachments:
Simple_RSI_Strategy.java [9.25 KiB]
Downloaded 314 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Running multiple strategies with same currency pair trade each Post rating: 0   New post Posted: Fri 06 Jul, 2012, 12:36 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Consider adding a new parameter:
    @Configurable("Label prefix")
    public String label= "myPrefix";
And then adjusting the first line of the getLabel function:
String label = prefix + instrument.name();


 

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