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 to set Period to 1 pip
 Post subject: How to set Period to 1 pip Post rating: 0   New post Posted: Wed 29 Dec, 2010, 14:08 

User rating: 0
Joined: Thu 02 Sep, 2010, 05:01
Posts: 49
Hi Support,
I'd like to set the Period in strategy to "1 Pip" (like it is possible in the chart). How can I do this?

Best regards,
Frank


 
 Post subject: Re: How to set Period to 1 pip Post rating: 0   New post Posted: Tue 04 Jan, 2011, 13:13 

User rating: 0
Joined: Thu 02 Sep, 2010, 05:01
Posts: 49
Cyps3178 wrote:
similar question here..but for 12Hrs periods...

Thx in advance for answer


Hi Cyps3178,
I think you can use the following code:

import java.util.concurrent.TimeUnit;

Period myPeriod = Period.createCustomPeriod(Unit.Minute, 720);   //60 Mins * 12  = 720 Mins


Best regards,
Frank


 
 Post subject: Re: How to set Period to 1 pip Post rating: 0   New post Posted: Tue 04 Jan, 2011, 14:28 
User avatar

User rating: 2
Joined: Tue 17 May, 2011, 16:35
Posts: 10
Location: ItalyItaly
Hi Frank,

[quote="Frank"]Hi Support,
I'd like to set the Period in strategy to "1 Pip" (like it is possible in the chart). How can I do this?

Best regards,
Frank[/quote]

I guess the walk around could be the following:
in onTick method skip all ticks until price has moved a set number of pips from the last processed tick.
Like described in RoadRunner post.

I don't see any other possibility at the moment until this feature will be released.

Green pips,
chriz


 
 Post subject: Re: How to set Period to 1 pip Post rating: 0   New post Posted: Thu 06 Jan, 2011, 12:55 

User rating: 0
Joined: Thu 02 Sep, 2010, 05:01
Posts: 49
chrizz wrote:
Hi Frank,

Frank wrote:
Hi Support,
I'd like to set the Period in strategy to "1 Pip" (like it is possible in the chart). How can I do this?

Best regards,
Frank


I guess the walk around could be the following:
in onTick method skip all ticks until price has moved a set number of pips from the last processed tick.
Like described in RoadRunner post.

I don't see any other possibility at the moment until this feature will be released.

Green pips,
chriz


Hi chriz,
your suggestion sounds interesting, but if I filter ticks in onTick method to obtain a Range Bar of 1 pip, then how can I apply to the Range Bar a simple indicator like ema that require a type Period that is Time Bar based ?

Best regards,
Frank


 
 Post subject: Re: How to set Period to 1 pip Post rating: 0   New post Posted: Thu 06 Jan, 2011, 13:47 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
If you want to use the tick period in your strategy, please consider the TICK constant from the Period class:
   
Period indicatoPeriod = Period.TICK;


 

Jump to:  

cron
  © 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