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.

indicator based on ticks
 Post subject: indicator based on ticks Post rating: 0   New post Posted: Wed 12 Jun, 2013, 07:01 

User rating: 2
Joined: Fri 17 May, 2013, 06:58
Posts: 76
Location: SwedenSweden
Hi,

What is the best approach performance wise to implement an indicator based on ticks?

Example: let's say that I want an SMA indicator on the last 1000 ticks. When implementing my strategy I could calculate this based on the calls to the onTick method since this is the first place where the ticks are provided to my strategy. However, looking at the indicator examples on https://www.dukascopy.com/wiki/#SMA_Crossover you're using the IHistory interface. Will the IHistory implementation fetch the last 1000 ticks from your server for every new tick or will it cache the ticks that was provided to the onTick method?

Also, is it possible to create an indicator sub chart from a strategy without implementing the IIndicator interface (i.e., to create the indicator view without using the IIndicator interface)?

Thanks in advance.

Kind Regards,
Henrik


 
 Post subject: Re: indicator based on ticks Post rating: 0   New post Posted: Wed 12 Jun, 2013, 07:55 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
whiletrue wrote:
What is the best approach performance wise to implement an indicator based on ticks?
Do you mean using indicator from strategy or implementing your own custom indicator?
whiletrue wrote:
Will the IHistory implementation fetch the last 1000 ticks from your server for every new tick or will it cache the ticks that was provided to the onTick method?
Ticks get cached locally, only new ticks get taken from the server.
whiletrue wrote:
Also, is it possible to create an indicator sub chart from a strategy without implementing the IIndicator interface (i.e., to create the indicator view without using the IIndicator interface)?
Do you mean using indicator from strategy or implementing your own custom indicator?


 
 Post subject: Re: indicator based on ticks Post rating: 0   New post Posted: Wed 12 Jun, 2013, 09:04 

User rating: 2
Joined: Fri 17 May, 2013, 06:58
Posts: 76
Location: SwedenSweden
Hi again,

I want to implement my own custom indicator based on ticks (not bars). Is there an example where the indicator is implemented based on ticks?

Thanks.

/Henrik


 
 Post subject: Re: indicator based on ticks Post rating: 0   New post Posted: Wed 12 Jun, 2013, 09:19 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
whiletrue wrote:
I want to implement my own custom indicator based on ticks (not bars). Is there an example where the indicator is implemented based on ticks?
You don't require specific logic for the indicator to work on ticks. For instance, you can take most of the platform indicators and plot on the tick chart - their logic does not change when plotted on the tick chart. Note that for tick charts actually 1-second candle feed gets used.


 
 Post subject: Re: indicator based on ticks Post rating: 0   New post Posted: Wed 12 Jun, 2013, 11:30 

User rating: 2
Joined: Fri 17 May, 2013, 06:58
Posts: 76
Location: SwedenSweden
Ok, thanks.

Can I create a sub chart with a custom indicator directly from my strategy without using the IIndicator interface? If so, is there an example of this somewhere?

Thanks.

/Henrik


 
 Post subject: Re: indicator based on ticks Post rating: 0   New post Posted: Wed 12 Jun, 2013, 11:46 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=65&t=49210&p=71199


 

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