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.

How to handle custom indicator in JForex algo and IIndicator clarification
 Post subject: How to handle custom indicator in JForex algo and IIndicator clarification Post rating: 0   New post Posted: Thu 17 Sep, 2015, 17:54 

User rating: 0
Joined: Fri 04 Apr, 2014, 16:35
Posts: 50
Location: Monaco, Monte-Carlo
Hi support,

Please can you outline where I am supposed to store a custom made indicator so that I can refer to it in JForex code?

Also I was reading back through the Wiki and I think I have found a mistake:
Under "Method Calculate" in the "IIndicator Interface" page of the wiki (https://www.dukascopy.com/wiki/#IIndicator_interface) it says:

"If there is input array with 30 elements and calculate method is called for SMA indicator with ''startIndex'' 0 and ''endIndex'' 29, then if there is time period of 20, indicator will have ''firstValueIndex'' 20 and ''lastValueIndex 29."

Given that arrays start at 0 and not at 1, surely a 20 period SMA indicator would have a "firstValueIndex" of 19, rather than 20?

Also please can you provide more clarity in the wiki about the following:
--"firstValueIndex'' and ''lastValueIndex" it really isn't clear (to me at least) which one is the latest value (i.e. the current candle/bar) or the earliest (i.e. the candle/bar furthest back in time)

--input array. It is incredibly unclear as to whether input[0] or input[length-1] is the most recent price.

Thanks


 
 Post subject: Re: How to handle custom indicator in JForex algo and IIndicator clarification Post rating: 0   New post Posted: Wed 23 Sep, 2015, 15:11 

User rating: 0
Joined: Fri 04 Apr, 2014, 16:35
Posts: 50
Location: Monaco, Monte-Carlo
Hi Support,
Is there any update on this?
Thanks


 
 Post subject: Re: How to handle custom indicator in JForex algo and IIndicator clarification Post rating: 0   New post Posted: Mon 28 Sep, 2015, 13:24 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
There are two options:
1) Only indicator name is specified: @CustomIndicators("Indicator.jfx")
In this case indicator must be placed in "<Default strategy folder>\files\Indicator.jfx"
<Default strategy folder> can be set in Tools > Preferences > Advanced > Strategies path

2) Full path to indicator .jfx file is provided: @CustomIndicators("C:\\Work\\Indicator.jfx")


 
 Post subject: Re: How to handle custom indicator in JForex algo and IIndicator clarification Post rating: 0   New post Posted: Mon 28 Sep, 2015, 16:26 

User rating: 0
Joined: Fri 04 Apr, 2014, 16:35
Posts: 50
Location: Monaco, Monte-Carlo
Thank you,

Can you please also add some clarity to my other questions?

J


 
 Post subject: Re: How to handle custom indicator in JForex algo and IIndicator clarification Post rating: 0   New post Posted: Tue 29 Sep, 2015, 15:18 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please clarify your questions and choose 1 most important one.


 
 Post subject: Re: How to handle custom indicator in JForex algo and IIndicator clarification Post rating: 0   New post Posted: Wed 30 Sep, 2015, 12:26 

User rating: 0
Joined: Fri 04 Apr, 2014, 16:35
Posts: 50
Location: Monaco, Monte-Carlo
Quote:
Also please can you provide more clarity in the wiki about the following:
--"firstValueIndex'' and ''lastValueIndex" it really isn't clear (to me at least) which one is the latest value (i.e. the current candle/bar) or the earliest (i.e. the candle/bar furthest back in time)

--input array. It is incredibly unclear as to whether input[0] or input[length-1] is the most recent price.


 
 Post subject: Re: How to handle custom indicator in JForex algo and IIndicator clarification Post rating: 0   New post Posted: Fri 09 Oct, 2015, 14:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Input array is in chronological order. 0th element is the oldest.
firstValueIndex is older than lastValueIndex


 

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