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.

Updating indicator values every tick
 Post subject: Updating indicator values every tick Post rating: 0   New post Posted: Mon 19 Mar, 2012, 23:30 

User rating: 0
Joined: Sun 18 Mar, 2012, 17:13
Posts: 4
Hi,

Can I have an example code how to update indicator values on every tick? I tried to calculate indicator values using shift 0 but that yields NaN. Shift 1 gives the value of last bar I guess. So basically I want to see indicator values intra-bar...


 
 Post subject: Re: Updating indicator values every tick Post rating: 0   New post Posted: Tue 20 Mar, 2012, 15:01 

User rating: 0
Joined: Sun 18 Mar, 2012, 17:13
Posts: 4
Nevermind, I figured this one out. To get updates tick-by-tick on custom timeframes you need to first subscribe to the feed in onStart method.


 
 Post subject: Re: Updating indicator values every tick Post rating: 0   New post Posted: Sat 14 Jul, 2012, 19:24 

User rating: 0
Joined: Sun 22 Apr, 2012, 19:19
Posts: 54
Location: United KingdomUnited Kingdom
Hello rounder8

Any chance you could put some dummy code up for this. I am trying to calculate the value of an MA onTick and not getting the method to execute.

Any help greatly appreciated.

Tin


 
 Post subject: Re: Updating indicator values every tick Post rating: 0   New post Posted: Mon 16 Jul, 2012, 07:17 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide you example strategy and describe the launch case.


 
 Post subject: Re: Updating indicator values every tick Post rating: 0   New post Posted: Mon 16 Jul, 2012, 12:13 

User rating: 0
Joined: Sun 22 Apr, 2012, 19:19
Posts: 54
Location: United KingdomUnited Kingdom
Hello

So quite simply, for a short period from say 01/07/2012 12:00:00.000 to 01/07/2012 13:00:00.000 calculate EMA (14) for every tick and print values for 2 'before' and 1 tick 'after'. So, not at the onBar level, but on the onTick level.

T


 
 Post subject: Re: Updating indicator values every tick Post rating: 0   New post Posted: Mon 16 Jul, 2012, 12:42 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See the last case - the one with tick feed:
https://www.dukascopy.com/wiki/#Indicator_Calculation/Calculate_indicator_by_time_interval


 

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