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.

unsubscribe from instruments in Strategy
 Post subject: unsubscribe from instruments in Strategy Post rating: 0   New post Posted: Mon 10 Mar, 2014, 16:15 
User avatar

User rating: 0
Joined: Mon 07 Jan, 2013, 23:30
Posts: 19
Location: Ukraine, Odessa
Hi!
I have a question. Is it possible to usubscribe from instruments in onTick() method?
Not to filter them by "if (instrument == this.instrument)". I want to get ticks only from
single instrument, to force Strategy calculate faster.


 
The Best Answer  Post subject: Re: unsubscribe from instruments in Strategy Post rating: 2   New post Posted: Mon 10 Mar, 2014, 17:14 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
If you run REMOTE strategy all instruments are subscribed explicitly by your strategy. So it's up to you what instruments subscribe to.

If you run LOCAL strategy you can see the all subscribed instruments in the left pane named "Instruments". Right mouse click -> Remove All


 
 Post subject: Re: unsubscribe from instruments in Strategy Post rating: 0   New post Posted: Mon 10 Mar, 2014, 17:31 
User avatar

User rating: 0
Joined: Mon 07 Jan, 2013, 23:30
Posts: 19
Location: Ukraine, Odessa
Thanks a lot, compatriot! One question more.
Can i get bars in onBar() method only from one single time frame? Strategy gives me a lot of time frames, which i don't need.


 
 Post subject: Re: unsubscribe from instruments in Strategy Post rating: 1   New post Posted: Mon 10 Mar, 2014, 21:39 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
ivan_taranov wrote:
Can i get bars in onBar() method only from one single time frame?
No, you cannot.

Simple filter will have an insignificant cost for performance.


 
 Post subject: Re: unsubscribe from instruments in Strategy Post rating: 0   New post Posted: Mon 10 Mar, 2014, 23:04 
User avatar

User rating: 0
Joined: Mon 07 Jan, 2013, 23:30
Posts: 19
Location: Ukraine, Odessa
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