com.jfx.strategy
Class Strategy

java.lang.Object
  extended by com.jfx.MT4
      extended by com.jfx.strategy.Strategy
Direct Known Subclasses:
DummyStrategy, MainStrategy

public abstract class Strategy
extends MT4

Created by IntelliJ IDEA. User: roman Date: 22/5/2009 Time: 15:39:32


Nested Class Summary
 class Strategy.Instrument
           
 
Field Summary
 java.util.ArrayList<java.lang.String> groups
           
 java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> groupsMap
           
 java.util.ArrayList<Strategy.Instrument> instruments
           
 java.util.ArrayList<java.lang.String> symbols
           
 
Constructor Summary
Strategy()
           
 
Method Summary
 void close()
          Kills MT4 Client Terminal (remotely)
protected  void connect(java.lang.String termServerHost, int termServerPort, Broker mt4Server, java.lang.String mt4User, java.lang.String mt4Password)
           
abstract  void coordinate()
           
 void deinit()
           
 void disconnect()
          Disconnects from MT4 Client Terminal.
 java.util.ArrayList<Strategy.Instrument> getInstruments()
          Provides list of all available on MT4 Terminal instruments.
 int getPeriod()
           
 int getSlippage()
           
static Strategy getStrategy(java.lang.String id)
           
 java.lang.String getSymbol()
           
 java.util.ArrayList<java.lang.String> getSymbols()
          Provides list of all available on MT4 Terminal instruments.
 void init(java.lang.String symbol, int period, StrategyRunner strategyRunner)
           
 boolean isAlive()
           
 boolean isReconnect()
           
 boolean isTradeAllowed()
           
static Strategy removeStrategy(java.lang.String id)
           
 void setMt4Password(java.lang.String mt4Password)
           
 void setMt4Server(Broker mt4Server)
           
 void setMt4User(java.lang.String mt4User)
           
 void setReconnect(boolean reconnect)
           
 void setTermServerHost(java.lang.String termServerHost)
           
 void setTermServerPort(int termServerPort)
           
 
Methods inherited from class com.jfx.MT4
accountBalance, accountCompany, accountCredit, accountCurrency, accountEquity, accountFreeMargin, accountMargin, accountName, accountNumber, accountProfit, accountStopoutLevel, accountStopoutMode, comment, day, dayOfWeek, dayOfYear, getLastError, getStrategyRunner, 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, setOrdersProcessingChannel, setStrategyRunner, timeCurrent, year
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

groupsMap

public java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> groupsMap

groups

public java.util.ArrayList<java.lang.String> groups

symbols

public java.util.ArrayList<java.lang.String> symbols

instruments

public java.util.ArrayList<Strategy.Instrument> instruments
Constructor Detail

Strategy

public Strategy()
Method Detail

isAlive

public boolean isAlive()

getSymbol

public java.lang.String getSymbol()

getPeriod

public int getPeriod()

isTradeAllowed

public boolean isTradeAllowed()
                       throws ErrUnknownSymbol
Throws:
ErrUnknownSymbol

getSlippage

public int getSlippage()

getSymbols

public java.util.ArrayList<java.lang.String> getSymbols()
Provides list of all available on MT4 Terminal instruments. Valid only when connect() and init() methods are completed.

Returns:
List of all available on MT4 Terminal symbols.

getInstruments

public java.util.ArrayList<Strategy.Instrument> getInstruments()
Provides list of all available on MT4 Terminal instruments. Valid only when connect() and init() methods are completed.

Returns:
List of all available on MT4 Terminal instruments.

init

public void init(java.lang.String symbol,
                 int period,
                 StrategyRunner strategyRunner)
          throws ErrUnknownSymbol,
                 java.io.IOException
Throws:
ErrUnknownSymbol
java.io.IOException

isReconnect

public boolean isReconnect()

setReconnect

public void setReconnect(boolean reconnect)

deinit

public void deinit()

setTermServerHost

public void setTermServerHost(java.lang.String termServerHost)

setTermServerPort

public void setTermServerPort(int termServerPort)

setMt4Server

public void setMt4Server(Broker mt4Server)

setMt4User

public void setMt4User(java.lang.String mt4User)

setMt4Password

public void setMt4Password(java.lang.String mt4Password)

coordinate

public abstract void coordinate()

getStrategy

public static Strategy getStrategy(java.lang.String id)

removeStrategy

public static Strategy removeStrategy(java.lang.String id)

disconnect

public void disconnect()
                throws java.io.IOException
Disconnects from MT4 Client Terminal.

Throws:
java.io.IOException - in case of Terminal Server is unreachable

close

public void close()
           throws java.io.IOException
Kills MT4 Client Terminal (remotely)

Throws:
java.io.IOException - in case of Terminal Server is unreachable

connect

protected void connect(java.lang.String termServerHost,
                       int termServerPort,
                       Broker mt4Server,
                       java.lang.String mt4User,
                       java.lang.String mt4Password)
                throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2008-2009 Roman Gerasimenko.