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.

Complete guide for custom indicator build?
 Post subject: Complete guide for custom indicator build? Post rating: 0   New post Posted: Thu 16 Apr, 2015, 12:44 

User rating: 0
Joined: Thu 12 Mar, 2015, 16:04
Posts: 3
Location: UkraineUkraine
Why we need it?
A lot of us migrate to Ducascopy from Metatrader. We studied mql well, but have around zero exp in java :(
mql converter works, but it's ugly and noway to get converted code :(
Custom indicator subforum closed, but there no way to get help in JStore. Its store and no more.
VisualJforex has no ability to develope indicators :(
WiKi pages is helpless :(
BUT we NEED to build new custom indicators.
I propose to ask here question about custom indicators build only.

Some questions
In API some indicators use
    private double[][] inputs = new double[1][];
    new InputParameterInfo("Price", InputParameterInfo.Type.DOUBLE)

another one
    private double[][][] inputs = new double[1][][];
    new InputParameterInfo("Price", InputParameterInfo.Type.PRICE)

What is better and why?

also the same situation with main cycle
        int i, k;
        for (i = 1, k = dtenkanMaxResult.getNumberOfElements(); i < k; i++) {
and
       int i, j;
        for (i = startIndex, j = 0; i <= endIndex; i++, j++) {                           

Which way is better?


 
 Post subject: Re: Complete guide for custom indicator build? Post rating: 0   New post Posted: Fri 24 Apr, 2015, 15:05 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
1. JForex Wiki:
Currently input can be either DOUBLE, which means array of prices of one kind, or PRICE in which case system will give several arrays of prices - double[5][n] and BAR for array of IBar objects. Prices for PRICE type will be in the following order: open, close, high, low, volume.
When indicator needs for calculations several kinds of prices (open, close, high, low) or volume then one should use PRICE type of input.
For BAR type array of IBar objects also contains information about all kinds of prices, volume and time of the bar as well. This approach is more object oriented.
PRICE type is used when indicator needs only one kind of prices.
2. When indicator uses result of another indicator calculation one should use cycle with IndicatorResult.getNumberOfElements() number of iterations.
For iterating over elements of input arrays one should use startIndex and endIndex parameters as array index bounds.


 

Jump to:  

  © 1998-2024 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