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
 Post subject: Indicator Post rating: 0   New post Posted: Mon 28 Dec, 2015, 15:21 
User avatar

User rating: 0
Joined: Sun 08 Mar, 2015, 23:36
Posts: 7
Location: Russian FederationRussian Federation
i created ma indicator with period 1 and offer side=bid and compared to ticks
Image


Code at onStart():
        ticks = history.getTicks(instrument, begin.getMillis(), end.getMillis());
        double[] zz = indicators.ma(instrument,Period.TICK, OfferSide.ASK, IIndicators.AppliedPrice.CLOSE, 1, MaType.SMA, begin.getMillis(), end.getMillis());
        System.out.println("TICKS SIZE: "+ticks.size()+", zz.len: "+zz.length);
 
        /**
         * CREATING CHART.
         */
        Chart c = new Chart("NN out visualizer");
        c.pack();
        RefineryUtilities.centerFrameOnScreen(c);
        c.setVisible(true);
 
        /**
         * DRAWING INDICATOR.
         */
        for(int i=0; i<ticks.size(); i++) {
            c.add(new SimpleDateFormat("SSS ss mm HH dd MM yyyy").format(ticks.get(i).getTime()), zz[i], ticks.get(i).getBid());
            //add to graph: datetime, indicator[i] and bid[i]
        }


So, how to get indicator data correctly??????


 
 Post subject: Re: Indicator Post rating: 0   New post Posted: Tue 19 Jan, 2016, 15:16 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This is normal. Unlike candles ticks have different frequency in different time intervals. If raw tick data were used some indicators may get skewed in favor of regions with higher or lower tick frequency. Therefore, ticks are normalized so that there is around 1 tick per second.


 

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