Access .net DLL from Java -
i new java
, dll-s
i need access dll's methods java
. go easy on me.
i have tried using jna access dll here have done.
import com.sun.jna.library; public class mapper { public interface mtapi extends library { public boolean isstopped(); } public static void main(string []args){ mtapi lib = (mtapi) native.loadlibrary("mtapi", mtapi.class); boolean test = lib.isstopped(); system.out.println(test); } }
when run code, getting following error:
exception in thread "main" java.lang.unsatisfiedlinkerror:
error looking function 'isstopped':
the specified procedure not found.
i understand error saying cannot find function, have no idea how fix it.
i trying use api mt4api
and here method, attempting access mql4
can tell me doing wrong?
i have looked @ other alternatives, jni4net
, cannot working either.
if can link me tutorial shows me how set up, or knows how to, greatfull.
trading?
hunting milliseconds shave-off?
go rather distributed processing... safer relying on api !
while op directed onto how bend java
call .net dll-functions, let me sketch future-safer solution.
using ai/ml-regression based predictors forex trading, hunting in same forest. best solution found within last 12-years, having spent few hundreds man*years of experience, setup in following manner:
host a
executes trades: operates metatrader terminal 4, both script , ea --- distributed-processing system communicates with use of zeromq
low-latency messaging/signalling framework ( few tens of microseconds needed )
host b
executes ai/ml processing of predictions traded instrument ( few hundreds of microseconds apply )
cluster c
executes continuous ai/ml predictor re-trainings , hyperparameterspace model selections ( many cpu-hours indeed needed, continuous model self-adapting process running 24/7 )
signalling / messaging layer zeromq
has ports and/or bindings available , ready of mainstream , many of niche programming languages, including java
.
hidden dangers of going against published api:
while efforts system integration , testing immense, api specifications dangerous specification creeping.
this said, add countless man*months consumed on debugging after silent change in mt4 language specifications de-rail previous tools + libraries. why? imagine. time ago, mql4
stopped mql4
, silently shifted towards mql5
, under name new-mql4
. among other changes in compilation, there many small , big nails in coffin -- string
surprisingly ceased string
, hidden internal struct
-- 1 guess cause dll-calls.
so, beware of api creepings.
does hurt distributed processing solution?
no.
with wise message-layout design, there no adverse effects of metatrader terminal 4 behaviour , logic ( incl. strategy decision ) put outside creeping platform.
doable. fast , smart. use remote-gpu-cluster processing, if budget allows.
does work in strategy tester?
yes, does.
if has gut rely on in-built strategy tester, distributed-processing model still works there. performance depends on preferred style of modelling, full 1 year, tick-by-tick simulation, quite complex ai/ml components took few days on common cots desktops pc-systems ( after years of quant r&d, not use strategy tester internally @ all, request batch-test y/y tick-data, commented here ).
Comments
Post a Comment