MQL4 - automated forex trading   /  

Forum

Subscribe to signal
Oscar Strategy Low Risk
21.09%, 3 509.31 USD
Screenshot
38-قند و شکر6, D1
Demo
MTF MomentumMTF Momentum Try product
MTF Momentum
Author: VincentX
Easy Way to Publish a Video at MQL4.CommunityEasy Way to Publish a Video at MQL4.CommunityKCIndicator
KC
Author: Scriptor

MT4-Java API

Back to topics list  | 1 2 3 4 5 6 7 To post a new topic, please log in or register

avatar
77
rgerasimen 2009.10.28 11:10
 

I'd like to introduce MT4 Java API: http://www.easy-share.com/1908253435/jfx-1.2.2.tar.gz


MT4 Terminal Java API (JFX) is intended to provide Java interface to MetaQuotes trading
servers through the standard MetaTrader 4 client terminal (MT4 Terminal).

 
Ten "Errors" of a Newcomer in Trading?

Ten "Errors" of a Newcomer in Trading?

The article substantiates approach to building a trading system as a sequence of opening and closing the interrelated orders regarding the existing conditions - prices and the current values of each order's profit/loss, not only and not so much the conventional "alerts". We are giving an exemplary realization of such an elementary trading system.


avatar
77
rgerasimen 2009.10.28 11:10
 
rgerasimen:

I'd like to introduce MT4 Java API: http://www.easy-share.com/1908253435/jfx-1.2.2.tar.gz


MT4 Terminal Java API (JFX) is intended to provide Java interface to MetaQuotes trading
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
*/
}
}

avatar
77
rgerasimen 2009.10.28 11:10
 
// 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);


avatar
77
rgerasimen 2009.10.28 11:11
 


avatar
77
rgerasimen 2009.10.28 13:34
 
No docs archive
Attached files:
  jfxv1.2.3_1.zip  (3 616.82 KB)

avatar
77
rgerasimen 2009.10.28 13:41
 
Javadoc
Attached files:
  jfxp1.2.3sdocs.zip  (746.64 KB)

avatar
77
rgerasimen 2009.10.29 10:30
 


avatar
273
bearnaked 2009.10.29 15:08
 
rgerasimen:


Nice!!!!

Congratulations

Dan aka BearNaked


avatar
443
blogzr3 2009.10.29 15:38
 

Is this an academic exercise?


What can you do in Java that you cannot do in MQL4?



avatar
191
robotalfa 2009.10.29 16:03
 
blogzr3:

Is this an academic exercise?


What can you do in Java that you cannot do in MQL4?


More sophisticated robots... Java is object oriented MQL4 is not.

 

avatar
77
rgerasimen 2009.10.29 19:39
 
blogzr3:

Is this an academic exercise?


What can you do in Java that you cannot do in MQL4?


at least, you can set breakpoints

Back to topics list   | 1 2 3 4 5 6 7  

To add comments, please log in or register