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.

Use of custom Indicators in Standalone JForex API Strategy
 Post subject: Use of custom Indicators in Standalone JForex API Strategy Post rating: 0   New post Posted: Tue 15 Mar, 2016, 19:31 
User avatar

User rating: 0
Joined: Wed 10 Oct, 2012, 09:47
Posts: 33
Location: GermanyGermany
Hello,
I coded custom indicator which is functional in JForex Platform.
Now I wanted to use it in my strategy (standalone JForex API without JForex Platform).
So I took as an example

Object[] rsiObject2=indicators.calculateIndicator(trading_instrument, periodbar, new OfferSide[] {OfferSide.BID}, "RSI", new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE}, new Object[] {14} , Filter.ALL_FLATS, 2, bidBar.getTime(), 0);

this surely works, since "RSI" is standard.

I tried
Object[] bmrObject=indicators.calculateIndicator(trading_instrument, periodbar, new OfferSide[] {OfferSide.BID}, "BMR_DRAFT", new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE}, new Object[] {14} , Filter.ALL_FLATS, 2, bidBar.getTime(), 0);

where "BMR_DRAFT" is the unique name given by me in
 new IndicatorInfo("BMR_draft", "Gives BMR", "My indicators", true, false, false, 1, 1, 2); 

when coding this indicator.
After running I got an exception
---
Exception message: Indicator with name BMR_DRAFT was not found
com.dukascopy.api.JFException: Indicator with name BMR_DRAFT was not found
at com.dukascopy.api.impl.Indicators$IndicatorCalc.calculate(Indicators.java:6400)
at com.dukascopy.api.impl.Indicators.calculateIndicator(Indicators.java:4731)....
---
And this is quite logical! Since the system has no Idea about my indicator.
So, how can I still use my custom indicator???


 
 Post subject: Re: Use of custom Indicators in Standalone JForex API Strategy Post rating: 0   New post Posted: Wed 23 Mar, 2016, 13:37 
User avatar

User rating: 0
Joined: Wed 10 Oct, 2012, 09:47
Posts: 33
Location: GermanyGermany
Hello Support, could please , help me with my issue? Or at least say me if I am wrong when asking such a qeustion. Otherwise writing "customer Indicator" is useless, whereas in MT4 use of such customer indicator in any strategy was straightforward!


 
 Post subject: Re: Use of custom Indicators in Standalone JForex API Strategy Post rating: 0   New post Posted: Wed 30 Mar, 2016, 09:09 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The indicator must be first registered with the strategy context. Here is an example of how to do that:
https://www.dukascopy.com/wiki/#Use_cus ... strategies


 

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