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.
 Broker getMt4Server()
           
 java.lang.String getMt4User()
           
 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.
 java.lang.String getTermServerHost()
           
 int getTermServerPort()
           
protected  long getTZCorrectionOffset(long time)
           
 void init(java.lang.String symbol, int period, StrategyRunner strategyRunner)
           
 boolean isAlive()
           
 boolean isReconnect()
           
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)
           
 void setTimeZoneCorrectionOffset(long timeZoneCorrectionOffset)
           
 
Methods inherited from class com.jfx.MT4
accountBalance, accountCompany, accountCredit, accountCurrency, accountEquity, accountFreeMargin, accountFreeMarginCheck, accountFreeMarginMode, accountLeverage, accountMargin, accountName, accountNumber, accountProfit, accountServer, accountStopoutLevel, accountStopoutMode, alert, comment, day, dayOfWeek, dayOfYear, getLastError, getStrategyRunner, getTickCount, hideTestIndicators, hour, iAC, iAD, iADX, iAlligator, iAO, iATR, iBands, iBars, iBarShift, iBearsPower, iBullsPower, iBWMFI, iCCI, iClose, iCustom, iDeMarker, iEnvelopes, iForce, iFractals, iGator, iHigh, iHighest, iIchimoku, iLow, iLowest, iMA, iMACD, iMFI, iMomentum, iOBV, iOpen, iOsMA, iRSI, iRVI, iSAR, isConnected, isDemo, isDllsAllowed, isExpertEnabled, isLibrariesAllowed, isOptimization, isStopped, iStdDev, isTesting, iStochastic, isTradeAllowed, isTradeContextBusy, isVisualMode, iTime, iVolume, iWPR, marketInfo_MODE_TIME, marketInfo, messageBox, minute, month, objectCreate, objectCreate, objectCreate, objectDelete, objectDescription, objectFind, objectGet, objectGetFiboDescription, objectGetShiftByValue, objectGetValueByShift, objectMove, objectName, objectsDeleteAll, 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, period, playSound, print, refreshRates, seconds, setOrdersProcessingChannel, setStrategyRunner, symbol, terminalCompany, terminalName, terminalPath, timeCurrent, uninitializeReason, windowBarsPerChart, windowExpertName, windowFind, windowFirstVisibleBar, windowHandle, windowIsVisible, windowOnDropped, windowPriceMax, windowPriceMin, windowPriceOnDropped, windowRedraw, windowScreenShot, windowsTotal, windowTimeOnDropped, windowXOnDropped, windowYOnDropped, 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()

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

setTimeZoneCorrectionOffset

public void setTimeZoneCorrectionOffset(long timeZoneCorrectionOffset)

getTZCorrectionOffset

protected long getTZCorrectionOffset(long time)
Overrides:
getTZCorrectionOffset in class MT4

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

getTermServerHost

public java.lang.String getTermServerHost()

getTermServerPort

public int getTermServerPort()

getMt4Server

public Broker getMt4Server()

getMt4User

public java.lang.String getMt4User()


Copyright © 2008-2009 Roman Gerasimenko.