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.

Multiple instances of User Indicators
 Post subject: Multiple instances of User Indicators Post rating: 0   New post Posted: Wed 20 May, 2015, 19:27 
User avatar

User rating: 0
Joined: Wed 18 Jun, 2014, 11:34
Posts: 3
Location: United Kingdom,
I'd like to call separate instances of a customer indicator I have created. But I'm not sure how to have multiple instances as more than one call to calculate access a single instance of the indicator. Please see code attachment. The output this strategy produces as follows showing the threshold setting from the previous call already in place (keep switches between 10 and 50).

18:18:16 Existing threshold: 10.0, new threshold: 50.0
18:18:16 2. Calling calculate with threshold: 50.0
18:18:16 Existing threshold: 50.0, new threshold: 10.0
18:18:16 1. Calling calculate with threshold: 10.0

Clearly my code is crap but not sure how to fix. I.e. how can I have 2 or more instances of a user indicator please? thanks.


Attachments:
File comment: Example code
TestStrategy.java [6.33 KiB]
Downloaded 103 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.
 
 Post subject: Re: Multiple instances of User Indicators Post rating: 0   New post Posted: Wed 03 Jun, 2015, 15:09 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Indicator calculations should be based only on input prices and optional input parameters.
Is there a situation where this is insufficient?


 
 Post subject: Re: Multiple instances of User Indicators Post rating: 0   New post Posted: Thu 11 Jun, 2015, 10:17 
User avatar

User rating: 0
Joined: Wed 18 Jun, 2014, 11:34
Posts: 3
Location: United Kingdom,
Hi, yes I agree so I havent explained my self very well. I was trying to create a strategy where I have 2 indicators and where they cross I either buy or sell. However I couldn't find a code model where you can have 2 separate instances of the same custom indicator where each instance would have its own set of parameters. When I tried to have 2 separate instances of the same indicator it didnt work as it only generated a single instance. Obviously my attempt was poor however I couldnt figure out the correct way? Does that make better sense? cheers.


 
 Post subject: Re: Multiple instances of User Indicators Post rating: 0   New post Posted: Mon 15 Jun, 2015, 08:10 
User avatar

User rating: 2
Joined: Sat 02 May, 2015, 20:20
Posts: 20
Location: Ukraine, Kyiv
Along these lines, How do I call multiple custom indicators. What is the syntax here??? It would be VERY HELPFUL in your API to give simple examples of syntax like MQL does. That would solve probably 30% of the questions here on this forum...

@CustomIndicators("E:\\Documents and Settings\\Administrator\\My Documents\\Jforex\\Indicators\\Best_Volume.jfx")
("E:\\Documents and Settings\\Administrator\\My Documents\\Jforex\\Indicators\\MDDummy.jfx")


Thanks!
TBB


 

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