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.

about the period of 1 pip code....
 Post subject: about the period of 1 pip code.... Post rating: 0   Post Posted: Wed 27 Mar, 2013, 16:05 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
As shown,I want to know how to write the period of 1 pip.
pls help me.


This is 1 minute code,how to write 1 pip。

@Configurable(value = "Period",readOnly = true,description = "This period can not be edited")public Period selectedPeriod = Period.ONE_MIN;


Attachments:
Period.jpg [10.06 KiB]
Downloaded 358 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: about the period of 1 pip code.... Post rating: 0   Post Posted: Thu 28 Mar, 2013, 11:24 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
use:
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/PriceRange.html
Note that for such case you will only be able to choose one from the predefined values. For wider price range selection, consider using the int type and then getting the PriceRange by using the following method:
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/PriceRange.html#valueOf(int)


 
 Post subject: Re: about the period of 1 pip code.... Post rating: 0   Post Posted: Sun 31 Mar, 2013, 18:19 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
API Support wrote:
use:
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/PriceRange.html
Note that for such case you will only be able to choose one from the predefined values. For wider price range selection, consider using the int type and then getting the PriceRange by using the following method:
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/PriceRange.html#valueOf(int)




:( :( :( :(
I still don't know how to write code, to explain in detail again....PLEASE HELP


 
 Post subject: Re: about the period of 1 pip code.... Post rating: 0   Post Posted: Tue 02 Apr, 2013, 08:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide your example strategy of how far you have got. Please describe which place you can't figure out how to implement.


 
 Post subject: Re: about the period of 1 pip code.... Post rating: 0   Post Posted: Tue 02 Apr, 2013, 13:59 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
API Support wrote:
Please provide your example strategy of how far you have got. Please describe which place you can't figure out how to implement.



My code is


import com.dukascopy.api.PriceRange;
....
@Configurable(value="Period")public Period myPeriod = Period.ONE_PIP;



then the system messages is "12:55:36 Period.ONE_PIP cannot be resolved"...

how to fix it??


 
 Post subject: Re: about the period of 1 pip code.... Post rating: 0   Post Posted: Tue 02 Apr, 2013, 14:25 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
use:
PriceRange
instead of Period.


 
 Post subject: Re: about the period of 1 pip code.... Post rating: 0   Post Posted: Tue 02 Apr, 2013, 16:03 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
API Support wrote:
use:
PriceRange
instead of Period.



I edited the new code is
@Configurable(value="Period")public PriceRange myPeriod = PriceRange.ONE_PIP;

is successful!But when I run the code,it says "!UNSUPPORTED TYPE!"

what's that mean?
And,is the new code run the 1PIP right?


 
 Post subject: Re: about the period of 1 pip code.... Post rating: 0   Post Posted: Tue 02 Apr, 2013, 16:07 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
No it means that you will have to go with the int data type and then use PriceRange.valueOf.


 
 Post subject: Re: about the period of 1 pip code.... Post rating: 0   Post Posted: Tue 02 Apr, 2013, 17:19 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
API Support wrote:
No it means that you will have to go with the int data type and then use PriceRange.valueOf.



I writed the new code.

public int A;
@Configurable(value="Period")public PriceRange myPeriod = PriceRange.valueOf(A);


is it right?


 
The Best Answer  Post subject: Re: about the period of 1 pip code.... Post rating: 1   Post Posted: Wed 03 Apr, 2013, 07:27 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
No it's not right, you should use int as @Configurable and use PriceRange.valueOf in the onStart.


 
 Post subject: Re: about the period of 1 pip code.... Post rating: 0   Post Posted: Wed 03 Apr, 2013, 11:28 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
API Support wrote:
No it's not right, you should use int as @Configurable and use PriceRange.valueOf in the onStart.



I write the new code,and it runs successful.
but is it right?



public class MyEa implements IStrategy
{
.....;
@Configurable(value="周期")public int myPeriod;
public void onStart(IContext context) throws JFException
{
....;
PriceRange.valueOf(myPeriod);
}
}


 
 Post subject: Re: about the period of 1 pip code.... Post rating: 0   Post Posted: Wed 03 Apr, 2013, 12:02 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Yes, the idea is right. Now you can define a IFeedDescriptor, assuming that you intend to work with range bars, see the PRICE_RANGE_AGGREGATION row in the Feed type table.


 
 Post subject: Re: about the period of 1 pip code.... Post rating: 0   Post Posted: Wed 03 Apr, 2013, 12:17 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
API Support wrote:
Yes, the idea is right. Now you can define a IFeedDescriptor, assuming that you intend to work with range bars, see the PRICE_RANGE_AGGREGATION row in the Feed type table.





This problem bothering me for a long time, thank you help me to solve!!

thank you very much!!


 

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