|
Detect running on Dukascopy Remote Server |
hyperscalper
|
Post subject: Detect running on Dukascopy Remote Server |
Post rating: 0
|
Posted: Thu 15 Aug, 2013, 13:49
|
|
User rating: 98
Joined: Mon 23 Jul, 2012, 02:02 Posts: 656 Location: United States, Durham, NC
|
What's the best way for a Strategy to detect automatically that it is executing on the Dukascopy Remote Servers, as opposed to a Local Run mode?
Thanks ! HyperScalper
|
|
|
|
|
hyperscalper
|
Post subject: Re: Detect running on Dukascopy Remote Server |
Post rating: 0
|
Posted: Sat 17 Aug, 2013, 16:51
|
|
User rating: 98
Joined: Mon 23 Jul, 2012, 02:02 Posts: 656 Location: United States, Durham, NC
|
Maybe there are some identifiable Java System properties, or something like that which we could use as a detection method? Or the Remote Server could add some specific Java property which we could then detect also.... just some ideas
It's important because the Remote Strategy has to be "headless" so it should not try to annotate charts, etc... which are not available in that context.
Having an API function I guess would be better...
HyperScalper
|
|
|
|
|
jlongo
|
Post subject: Re: Detect running on Dukascopy Remote Server |
Post rating: 0
|
Posted: Sat 17 Aug, 2013, 17:23
|
|
User rating: 94
Joined: Mon 06 Feb, 2012, 12:22 Posts: 357 Location: Portugal, Castelo Branco
|
Hi HyperScalper:
Maybe, if you compare the string returned by your system with the one the strategy gets where is running, you can determine if not your system or systems, probabily is remote server...
See : String computername=InetAddress.getLocalHost().getHostName();
Maybe this can help in what you want.
One suggestion for Dukascopy developpers can be change the IEngine.getType() adding two more options on returned item like "REMOTEDEMO" and "REMOTELIVE"...
Trade well
JL
|
|
|
|
|
API Support
|
Post subject: Re: Detect running on Dukascopy Remote Server |
Post rating: 0
|
Posted: Mon 19 Aug, 2013, 08:27
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
We will add some methods.
|
|
|
|
|
hyperscalper
|
Post subject: Re: Detect running on Dukascopy Remote Server |
Post rating: 0
|
Posted: Mon 19 Aug, 2013, 18:22
|
|
User rating: 98
Joined: Mon 23 Jul, 2012, 02:02 Posts: 656 Location: United States, Durham, NC
|
My preliminary tests reveal that the Strategy module cannot get System properties. Unless my code is just wrong: if (runningRemotely) { consolePrintln("Dumping Server properties..."); try { Properties props = System.getProperties(); Enumeration e = props.propertyNames();
while (e.hasMoreElements()) { String key = (String) e.nextElement(); consolePrintln(key + " -- " + props.getProperty(key)); } } catch(Exception ex) { ex.printStackTrace(); } consolePrintln("end Server properties..."); }
I believe the Properties object props, is probably empty due to Security Restrictions on the server side? maybe. HyperScalper
|
|
|
|
|
hyperscalper
|
Post subject: Re: Detect running on Dukascopy Remote Server |
Post rating: 0
|
Posted: Wed 21 Aug, 2013, 11:23
|
|
User rating: 98
Joined: Mon 23 Jul, 2012, 02:02 Posts: 656 Location: United States, Durham, NC
|
More clarity on this subject of detecting whether a Strategy module is running on Dukascopy Remote Server.
The Exception to System.getProperties() is: access denied ("java.util.PropertyPermission" "*" "read,write")
However, specific system properties on the Remote Server are accessible via System.getProperty(String) using specific Java property key designations.
"java.version" yields: 1.7.0_25 "os.name" yields: SunOS "user.dir" yields: access denied ("java.util.PropertyPermission" "user.dir" "read")
Therefore, specific properties or behavior might easily be used to distinguish the Remote Server from systems on which a Local Run is performed.
HyperScalper
|
|
|
|
|
hyperscalper
|
Post subject: Re: Detect running on Dukascopy Remote Server |
Post rating: 0
|
Posted: Wed 21 Aug, 2013, 17:43
|
|
User rating: 98
Joined: Mon 23 Jul, 2012, 02:02 Posts: 656 Location: United States, Durham, NC
|
https://docs.oracle.com/javase/tutorial/ ... rties.htmlI know we're not exactly talking about RIA's but the above link says: All Rich Internet Apps can retrieve the following secure system properties: java.class.version java.vendor java.vendor.url java.version os.name os.arch os.version file.separator path.separator line.separator Sandbox Rich Internet Apps cannot access the following system properties: java.class.path java.home user.dir user.home user.name
|
|
|
|
|
API Support
|
Post subject: Re: Detect running on Dukascopy Remote Server |
Post rating: 0
|
Posted: Fri 20 Sep, 2013, 13:57
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
IEngine.getRunMode available with JForex-API 2.9.4
|
|
|
|
|
|
Pages: [
1
]
|
|
|
|
|