我想提请您注意我所开发的MT4 Java API
MT4终端Java API(JFX)旨在为MetaQuotes交易 提供一个Java接口。
通过标准的MetaTrader 4客户终端(MT4终端)与服务器连接。
通过标准的MetaTrader 4客户终端(MT4终端)与服务器连接。
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);
请在此附上文件。Easyshare很糟糕,因为它是。我只是一次又一次地收到等待500秒的信息。
如果你不介意的话,请描述一下MT4是如何与java进行交流的。我自己通过dll和TCP协议实现了这样的连接,所以我想知道你的连接是如何实现的?
soulmate >> :
如果您不介意的话,能否请您解释一下MT4是如何与java进行通信的?我自己是通过dll和TCP协议做的,所以我想知道在你那里是怎么做的。
如果您不介意的话,能否请您解释一下MT4是如何与java进行通信的?我自己是通过dll和TCP协议做的,所以我想知道在你那里是怎么做的。
我将尝试附上一份文件...
附加的文件:
rgerasimen >> :
我试着附上一份文件...
已经在档案中找到了,谢谢。