I would like to bring to your attention the MT4 Java API I have developed
The MT4 Terminal Java API (JFX) is intended to provide a Java interface to MetaQuotes trading
servers through the standard MetaTrader 4 client terminal (MT4 Terminal).
servers through the standard MetaTrader 4 client terminal (MT4 Terminal).
To make use of JFX API, one must create its own strategy java class, extending com.jfx.strategy.Strategy and overriding coordinate() method: public class MyStrategy extends com. jfx. strategy. Strategy { public void init( String symbol, int period, StrategyRunner strategyRunner) { super. init( symbol, period, strategyRunner); // // load existing orders, recover itself from the previous shutdown // } public void deinit() { // release resources on EA exit } public void coordinate() { // trading logic goes here /* make use of all API methods: accountBalance, accountCompany, accountCredit, accountCurrency, accountEquity, accountFreeMargin, accountMargin, accountName, accountNumber, accountProfit, comment, day, dayOfWeek, dayOfYear, getLastError, getTickCount, hour, iAC, iAD, iADX, iAlligator, iAO, iATR, iBands, iBars, iBarShift, iBearsPower, iBullsPower, iBWMFI, iCCI, iClose, iCustom, iDeMarker, iEnvelopes, iForce, iFractals, iGator, iHigh, iHighest, iLow, iLowest, iMA, iMACD, iMFI, iMomentum, iOBV, iOpen, iOsMA, iRSI, iRVI, iSAR, isConnected, isDemo, iStdDev, isTesting, iStochastic, isTradeContextBusy, isVisualMode, iTime, iVolume, iWPR, marketInfo, minute, month, objectCreate, objectCreate, objectCreate, objectDelete, objectGet, objectGetFiboDescription, objectSet, objectSetFiboDescription, objectSetText, objectsTotal, objectType, orderClose, orderCloseBy, orderClosePrice, orderCloseTime, orderComment, orderCommission, orderDelete, orderExpiration, orderLots, orderMagicNumber, orderModify, orderOpenPrice, orderOpenTime, orderPrint, orderProfit, orderSelect, orderSend,ordersHistoryTotal, orderStopLoss, ordersTotal, orderSwap, orderSymbol, orderTakeProfit, orderTicket, orderType, print, refreshRates, seconds, timeCurrent, year */ } }
// Java: double point = marketInfo( EURUSD, MarketInfo.MODE_POINT); double price = marketInfo( EURUSD, MarketInfo.MODE_ASK); buyPrice = price; int ticket = orderSend( EURUSD, TradeOperation.OP_BUY, 1, buyPrice, 2, price - 100 * point, price + 100 * point, "" + System. currentTimeMillis(), 0, new Date( System. currentTimeMillis() + 60 * 60 * 1000), -1 ); System. out. println("---------------------------------------"); System. out. println("Buy order ticket: " + ticket);
Pls attach file here. Easyshare sucks as is. I am only getting wait 500 seconds message over and over.
If you don't mind, please describe how MT4 communicates with java. I myself implemented such connection through dll and TCP protocol, so I wonder how it is done in yours?
soulmate >> :
If you don't mind, could you please explain how MT4 communicates with java? I did it myself through dll and TCP protocol, so I am wondering how it is done in yours?
If you don't mind, could you please explain how MT4 communicates with java? I did it myself through dll and TCP protocol, so I am wondering how it is done in yours?
I will try to attach a doc...
Files:
rgerasimen >> :
I'll try to attach a document...
Already found it in the archive, thanks.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register