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.

OpenPrice Indicator
 Post subject: OpenPrice Indicator Post rating: 0   New post Posted: Sun 12 Sep, 2010, 18:47 

User rating: 0
Joined: Wed 08 Sep, 2010, 13:36
Posts: 5
Hi, support

Whether can display openprice(lots...etc.) in custom indicator? Or they just can be displayed in strategy?

Thank you.


 
 Post subject: Re: OpenPrice Indicator Post rating: 0   New post Posted: Tue 14 Sep, 2010, 10:42 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
It's better to display open price int your strategy, but if you need to do this in the custom indicator, price can be accessed through input parameters. Firstly you need to specify InputParameterInfo.Type to PRICE and then cast input object to double array of arrays.
    InputParameterInfo[] inputParameterInfos = new InputParameterInfo[] {new InputParameterInfo("Input data", InputParameterInfo.Type.PRICE)};
    public void setInputParameter(int index, Object array) {
        double[][] inputs = (double[][]) array;
    }

Prices for PRICE type will be in the following order: open, close, high, low, volume.
Please take a look at the following JForex wiki page for more details: https://www.dukascopy.com/wiki/index.php ... ameterInfo


 
 Post subject: Re: OpenPrice Indicator Post rating: 0   New post Posted: Wed 15 Sep, 2010, 06:34 

User rating: 0
Joined: Wed 08 Sep, 2010, 13:36
Posts: 5
Thank you,support

Sorry, My English isn't good enough.

The openprice is the order's(position's) openprice rather than Bar's openprice (= bar.getOpen()).

I already draw a horizontal line by Bar's price in the chart in the custom indicator. Now I want to draw herizontal line by order's(position's) openprice in the chart in the custom indicator, is it possible? Or I only draw this herizontal line in the strategy?


 
 Post subject: Re: OpenPrice Indicator Post rating: 0   New post Posted: Wed 15 Sep, 2010, 09:49 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
No, it's not possible. You need to get order open price in your strategy. Indicators obtain input parameters based on bars.


 

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