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.

hello.apisupport.3 questions about F&Pchart
 Post subject: hello.apisupport.3 questions about F&Pchart Post rating: 0   New post Posted: Wed 22 Oct, 2014, 16:31 
User avatar

User rating: 0
Joined: Wed 28 Mar, 2012, 06:41
Posts: 25
Location: China, Beijing
1 F&Pchart setting .what is the third parameter, base period? what is this
what differrence between P&F(1pip*3)[1] and P&F(1pip*3)[7]


2 why I CREATe a new P&F(1pip*3)[1] and then ,use it in a new chart.
it was different from P&F(1pip*3)[7] at the beginning.but afer a few minutes...they beacame alike..,why?

Image
Image
3 I create strategy, test.java use ontick()
SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
formatter.setTimeZone(TimeZone.getTimeZone("GMT+0"));
String timecurrent = formatter.format(new Date(currBarTime));

long currBarTime = tick.getTime();
List<IPointAndFigure> bars = history.getPointAndFigures(instrument, myOfferSide,PriceRange.ONEMINITE, ReversalAmount.THREE,3, currBarTime, 0);

// printMe("sssss222222222222 " + thisBar.getTime());
printMe("012getClose()"+ bars.get(0).getClose()+" "+bars.get(1).getClose()+" "+ bars.get(2).getClose());
printMe("00000 " + formatter.format(new Date(bars.get(0).getTime()))+" "+formatter.format(new Date(bars.get(0).getEndTime())));
printMe("11111 " + formatter.format(new Date(bars.get(1).getTime()))+" "+formatter.format(new Date(bars.get(1).getEndTime())));
printMe("22222 " + formatter.format(new Date(bars.get(2).getTime()))+" "+formatter.format(new Date(bars.get(2).getEndTime())));

but the output is not the same with the results that in the P&F(1pip*3)[7]chart..?why??

Image


thank you..


Attachments:
QQ333333.png [203.81 KiB]
Downloaded 294 times
QQ222222222.png [394.83 KiB]
Downloaded 367 times
QQ1111111111.png [378.54 KiB]
Downloaded 330 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: hello.apisupport.3 questions about F&Pchart Post rating: 0   New post Posted: Fri 24 Oct, 2014, 07:40 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
1) Base period works as a starting point from which to calculate bars. Examples:
a) base period 1 - P&F bars will be calculated from every day's 00:00 or 21:00 (depends on chosen time zone in Preferences - Chart - Day start time)
b) base period 7 - P&F bars will be calculated from every week's 00:00 or 21:00 (depends on chosen time zone in Preferences - Chart - Day start time)
In theory the calculation of price aggregated bars starts with the first tick of the history. Practically for JForex this means to load all history and calculate bars from the first available tick. This would be very time and resource consuming process.
To speed it up, we invented base period. When the base period starts, price aggregation bars are calculated as if this would be the beginning of the history. So, as a result we don't load all history, but just e.g. 7 days (in case of base period [7]).

Image

2) It is possible, that after some time price aggregation bars become equal. But theoretically there is no limit of time span in which this should happen or happen at all.

3) The line:
List<IPointAndFigure> bars = history.getPointAndFigures(instrument, myOfferSide,PriceRange.ONEMINITE, ReversalAmount.THREE,3, currBarTime, 0);

Received bars are different from bars in chart, because this method uses default base period, which is 7 days with time zone EET (+3h utc). As a result a different bar is returned.
If you change time zone in Preferences - Chart - Day start time to EET, it will work correctly.

We apologize that the API is not updated yet. To indicate all parameters properly, you should use IHistory.getFeedData methods. Here is example with UTC base period:

        long currBarTime = history.getTimeOfLastTick(Instrument.EURUSD);
        IFeedDescriptor descriptor = new PointAndFigureFeedDescriptor(
                Instrument.EURUSD,
                PriceRange.ONE_PIP,
                ReversalAmount.THREE,
                OfferSide.BID,
                Period.createCustomPeriod(Unit.Day, 7, JFTimeZone.UTC));


        List<ITimedData> data = history.getFeedData(descriptor, 3, currBarTime, 0);


 
 Post subject: Re: hello.apisupport.3 questions about F&Pchart Post rating: 0   New post Posted: Sat 25 Oct, 2014, 09:04 
User avatar

User rating: 0
Joined: Wed 28 Mar, 2012, 06:41
Posts: 25
Location: China, Beijing
thank you very much.


 

Jump to:  

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