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.

SMA for a TICK period
 Post subject: SMA for a TICK period Post rating: 0   New post Posted: Wed 31 Mar, 2010, 10:17 

User rating: 0
Joined: Tue 02 Mar, 2010, 14:47
Posts: 3
Hi,
When trying to use the ma indicator in my strategy to calculate the SMA for Period.TICK, i get an error that says i cannot have a "shift" argument. I'm using zero shift.

Question: How do I get the SMA for Period.TICK for say a 20 tick period.

thanks for the help.


 
 Post subject: Re: SMA for a TICK period Post rating: 0   New post Posted: Wed 31 Mar, 2010, 13:40 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
These are available periods for indicators in JForex:
  • Period.TEN_SECS;
  • Period.ONE_MIN;
  • Period.FIVE_MINS;
  • Period.TEN_MINS;
  • Period.FIFTEEN_MINS;
  • Period.THIRTY_MINS;
  • Period.ONE_HOUR;
  • Period.FOUR_HOURS;
  • Period.DAILY;
  • Period.WEEKLY;
  • Period.MONTHLY
Quote:
How do I get the SMA for Period.TICK for say a 20 tick period.
It's not possible. The smallest period is ten seconds.


 
 Post subject: Re: SMA for a TICK period Post rating: 0   New post Posted: Tue 30 Nov, 2010, 15:58 

User rating: -
Hi

can you please help - if I change this period.Daily to period.one-hour - it will not compile


//Fetching previous Hourly bar from history
IBar prevBar = history.getBar(this.instrument, Period.One_Hour, OfferSide.ASK, 1);

Much appreciated
Polla


 
 Post subject: Re: SMA for a TICK period Post rating: 0   New post Posted: Wed 01 Dec, 2010, 11:40 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
Please consider this:
IBar prevBar = history.getBar(this.instrument, Period.ONE_HOUR, OfferSide.ASK, 1);


 

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