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.

define the slope of MA
 Post subject: define the slope of MA Post rating: 0   Post Posted: Tue 27 Mar, 2012, 09:15 

User rating: 1
Joined: Wed 07 Mar, 2012, 05:56
Posts: 101
Location: New CaledoniaNew Caledonia
hello support again ;),

i would like to define the slope of Ma, i mean :

if the value of the ma at the previous candle is 1.3210 and the value of the ma at the current candle is 1.32
then
the slope is :
1.3210-1.32 = 0.0010
.0010*10000 = 10

thereafter i would like to recover this value for integrate in my signal condition for example :

if (mavalue >= 10){
"signal condition"
}else if (mavalue <= 10 ){
"signal condition"
}

i think it's a good way to define the range period or the trend period.

could you help me please.

best regards


 
 Post subject: Re: define the slope of MA Post rating: 0   Post Posted: Tue 27 Mar, 2012, 12:31 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Try the example strategy attached to the example:
https://www.dukascopy.com/wiki/#Indicato ... e_interval
Then change the function to use the following ma method:
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/IIndicators.html#ma(com.dukascopy.api.Instrument,%20com.dukascopy.api.Period,%20com.dukascopy.api.OfferSide,%20com.dukascopy.api.IIndicators.AppliedPrice,%20int,%20com.dukascopy.api.IIndicators.MaType,%20com.dukascopy.api.Filter,%20int,%20long,%20int)

As examples also see strategies that use MA:
https://www.dukascopy.com/wiki/#SMA_Simple
https://www.dukascopy.com/wiki/#Martingale_with_MA
https://www.dukascopy.com/wiki/#SMA_Crossover


 

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