Dukascopy
 
 
Wiki JStore Search Login

Trying to code indicator
 Post subject: Trying to code indicator Post rating: 0   New post Posted: Mon 10 Nov, 2014, 22:58 
User avatar

User rating: 0
Joined: Thu 23 Jan, 2014, 21:43
Posts: 17
Location: Peru, La Perla
Hello, I found this code on other language from an indicator based on Andrew Abraham indictor developed in the Trading the Trend article of TASC September 1998

Looks really simple in code, get the atr1 input to use it on wma and then multiply it and add or substract from the highest or low value of a number of bars (lenght) then finish with comparing with the close price of last candle. I had developed some strategies on java and visual jforex. Despite some dificulties, its relative intuitive but with indicators I still dont get how to code them and the information in wiki and examples aren't really helping me. How can I find information to code this? Thanks

Length = input(21, minval=1),
Multiplier = input(3, minval=1)
avgTR = wma(atr(1), Length)
highestC = highest(Length)
lowestC = lowest(Length)
hiLimit = highestC[1]-(avgTR[1] * Multiplier)
loLimit = lowestC[1]+(avgTR[1] * Multiplier)
ret = if(close > hiLimit and close > loLimit, hiLimit,
if(close < loLimit and close < hiLimit, loLimit, nz(ret[1], 0)))

plot(ret, color= blue )


 
 Post subject: Re: Trying to code indicator Post rating: 0   New post Posted: Tue 11 Nov, 2014, 11:44 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Did you tried to build this code using visual Jforex so far?
Can you please post your what you did so far and let us know at which level you are blocked?

Thanks


 
 Post subject: Re: Trying to code indicator Post rating: 0   New post Posted: Tue 11 Nov, 2014, 16:33 
User avatar

User rating: 0
Joined: Thu 23 Jan, 2014, 21:43
Posts: 17
Location: Peru, La Perla
To be honest I tried to but got completely lost because I don't really understand the indicator coding. Theres not many information on wiki page, just 4 pages and then a few especific examples and no one helps me. I didn't know I can code this in visual jforex, how can I find information on how code indicators on visual jforex? I always thought this was only for strategies. I will still try to code it on jforex (java) and try to send a code, but it well be hard because I still dont understand it. :(

thanks


 
 Post subject: Re: Trying to code indicator Post rating: 0   New post Posted: Tue 11 Nov, 2014, 17:18 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Well using Visual Jforex it is not possible to do the following:
avgTR = wma(atr(1), Length)
As an indicator block has a specified drop-down list for its calculation method:
Image

I believe it is better to code using Java language if you can do it otherwise you can ask your question into the automated trading forum:
viewforum.php?f=89

Thanks !


Attachments:
WMA.png [23.01 KiB]
Downloaded 411 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.
 

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