| Modifier and Type | Field and Description |
|---|---|
static char |
ARG_BEGIN |
static char |
ARG_END |
static int |
PROTO |
| Constructor and Description |
|---|
MT4() |
| Modifier and Type | Method and Description |
|---|---|
double |
accountBalance()
Returns balance value of the current account (the amount of money on the account).
|
String |
accountCompany()
Returns the brokerage company name where the current account was registered.
|
double |
accountCredit()
Returns credit value of the current account.
|
String |
accountCurrency()
Returns currency name of the current account.
|
double |
accountEquity()
Returns equity value of the current account.
|
double |
accountFreeMargin()
Returns free margin value of the current account.
|
double |
accountFreeMarginCheck(String symbol,
TradeOperation cmd,
double volume)
Returns free margin that remains after the specified position has been opened at the current price on the current account.
|
double |
accountFreeMarginMode()
Calculation mode of free margin allowed to open positions on the current account.
|
int |
accountLeverage()
Returns leverage of the current account.
|
double |
accountMargin()
Returns margin value of the current account.
|
String |
accountName()
Returns the current account name.
|
int |
accountNumber()
Returns the number of the current account
|
double |
accountProfit()
Returns profit value of the current account.
|
String |
accountServer()
Returns the connected server name.
|
int |
accountStopoutLevel()
Returns the value of the Stop Out level.
|
int |
accountStopoutMode()
Returns the calculation mode for the Stop Out level.
|
void |
alert(String arg)
Displays a dialog box containing the user-defined data.
|
void |
comment(String comments)
The function outputs the comment defined by the user in the left top corner of the chart.
|
int |
day()
Returns the current day of the month, i.e., the day of month of the last known server time.
|
int |
dayOfWeek()
Returns the current zero-based day of the week (0-Sunday,1,2,3,4,5,6) of the last known server time.
|
int |
dayOfYear()
Returns the current day of the year (1 means 1 January,..,365(6) does 31 December), i.e., the day of year of the last known server time.
|
int |
fromDate(Date dTime) |
int |
getLastError()
The function returns the last occurred error, then the value of special last_error variable where the last error code is stored will be zeroized.
|
StrategyRunner |
getStrategyRunner() |
int |
getTickCount()
The GetTickCount() function retrieves the number of milliseconds that have elapsed since the system was started.
|
boolean |
globalVariableCheck(String name)
Returns TRUE if the global variable exists, otherwise, returns FALSE.
|
boolean |
globalVariableDel(String name)
Deletes the global variable.
|
double |
globalVariableGet(String name)
Returns the value of an existing global variable or 0 if an error occurs.
|
String |
globalVariableName(int index)
The function returns the name of a global variable by its index in the list of global variables.
|
int |
globalVariablesDeleteAll(String prefix)
Deletes global variables.
|
Date |
globalVariableSet(String name,
double value)
Sets a new value of the global variable.
|
boolean |
globalVariableSetOnCondition(String name,
double value,
double check_value)
Sets the new value of the existing global variable if the current value equals to the third parameter check_value.
|
int |
globalVariablesTotal()
The function returns the total count of global variables.
|
void |
hideTestIndicators(boolean shift)
The function sets a flag hiding indicators called by the Expert Advisor.
|
int |
hour()
Returns the hour (0,1,2,..23) of the last known server time by the moment of the program start (this value will not change within the time of the program execution).
|
double |
iAC(String symbol,
Timeframe timeframe,
int shift)
Calculates the Bill Williams' Accelerator/Decelerator oscillator.
|
double |
iAD(String symbol,
Timeframe timeframe,
int shift)
Calculates the Accumulation/Distribution indicator and returns its value.
|
double |
iADX(String symbol,
Timeframe timeframe,
int period,
AppliedPrice appliedPrice,
ADXIndicatorLines mode,
int shift)
Calculates the Movement directional index and returns its value.
|
double |
iAlligator(String symbol,
Timeframe timeframe,
int jawPeriod,
int jawShift,
int teethPeriod,
int teethShift,
int lipsPeriod,
int lipsShift,
MovingAverageMethod maMethod,
AppliedPrice appliedPrice,
GatorMode mode,
int shift)
Calculates the Bill Williams' Alligator and returns its value.
|
double |
iAO(String symbol,
Timeframe timeframe,
int shift)
Calculates the Bill Williams' Awesome oscillator and returns its value.
|
double |
iATR(String symbol,
Timeframe timeframe,
int period,
int shift)
Calculates the Indicator of the average true range and returns its value.
|
double |
iBands(String symbol,
Timeframe timeframe,
int period,
int deviation,
int bandsShift,
AppliedPrice appliedPrice,
BandsIndicatorLines mode,
int shift)
Calculates the Movement directional index and returns its value.
|
int |
iBars(String symbol,
Timeframe timeframe)
Returns the number of bars on the specified chart.
|
int |
iBarShift(String symbol,
Timeframe timeframe,
Date time,
boolean exact)
Search for bar by open time.
|
double |
iBearsPower(String symbol,
Timeframe timeframe,
int period,
AppliedPrice appliedPrice,
int shift)
Calculates the Bears Power indicator and returns its value.
|
double |
iBullsPower(String symbol,
Timeframe timeframe,
int period,
AppliedPrice appliedPrice,
int shift)
Calculates the Bulls Power indicator and returns its value.
|
double |
iBWMFI(String symbol,
Timeframe timeframe,
int shift)
Calculates the Bill Williams Market Facilitation index and returns its value.
|
double |
iCCI(String symbol,
Timeframe timeframe,
int period,
AppliedPrice appliedPrice,
int shift)
Calculates the Commodity channel index and returns its value.
|
double |
iClose(String symbol,
Timeframe timeframe,
int shift)
Returns Close value for the bar of indicated symbol with timeframe and shift.
|
double |
iCustom(String symbol,
Timeframe timeframe,
String name,
int mode,
int shift)
Calculates the specified custom indicator and returns its value.
|
double |
iCustom(String symbol,
Timeframe timeframe,
String name,
int mode,
int shift,
double... params)
Calculates the specified custom indicator and returns its value.
|
double |
iCustom(String symbol,
Timeframe timeframe,
String name,
int mode,
int shift,
int... params)
Calculates the specified custom indicator and returns its value.
|
double |
iCustom(String symbol,
Timeframe timeframe,
String name,
int mode,
int shift,
String... params)
Calculates the specified custom indicator and returns its value.
|
double |
iDeMarker(String symbol,
Timeframe timeframe,
int period,
int shift)
Calculates the DeMarker indicator and returns its value.
|
double |
iEnvelopes(String symbol,
Timeframe timeframe,
int maPeriod,
MovingAverageMethod maMethod,
int maShitf,
AppliedPrice appliedPrice,
double deviation,
BandsIndicatorLines mode,
int shift)
Calculates the Envelopes indicator and returns its value.
|
double |
iForce(String symbol,
Timeframe timeframe,
int period,
MovingAverageMethod maMethod,
AppliedPrice appliedPrice,
int shift)
Calculates the Force index and returns its value.
|
double |
iFractals(String symbol,
Timeframe timeframe,
BandsIndicatorLines mode,
int shift)
Calculates the Fractals and returns its value.
|
double |
iGator(String symbol,
Timeframe timeframe,
int jawPeriod,
int jawShift,
int teethPeriod,
int teethShift,
int lipsPeriod,
int lipsShift,
MovingAverageMethod maMethod,
AppliedPrice appliedPrice,
BandsIndicatorLines mode,
int shift)
Gator oscillator calculation.
|
double |
iHigh(String symbol,
Timeframe timeframe,
int shift)
Returns High value for the bar of indicated symbol with timeframe and shift.
|
int |
iHighest(String symbol,
Timeframe timeframe,
Series type,
int count,
int start)
Returns the shift of the maximum value over a specific number of periods depending on type.
|
double |
iIchimoku(String symbol,
Timeframe timeframe,
int tenkan_sen,
int kijun_sen,
int senkou_span_b,
IchimokuSource mode,
int shift)
Calculates the Ichimoku Kinko Hyo and returns its value.
|
double |
iLow(String symbol,
Timeframe timeframe,
int shift)
Returns Low value for the bar of indicated symbol with timeframe and shift.
|
int |
iLowest(String symbol,
Timeframe timeframe,
Series type,
int count,
int start)
Returns the shift of the least value over a specific number of periods depending on type.
|
double |
iMA(String symbol,
Timeframe timeframe,
int period,
int maShift,
MovingAverageMethod maMethod,
AppliedPrice appliedPrice,
int shift)
Calculates the Moving average indicator and returns its value.
|
double |
iMACD(String symbol,
Timeframe timeframe,
int fastEMAPeriod,
int slowEMAPeriod,
int signalPeriod,
AppliedPrice appliedPrice,
MACDIndicatorLines mode,
int shift)
Calculates the Moving averages convergence/divergence and returns its value.
|
double |
iMFI(String symbol,
Timeframe timeframe,
int period,
int shift)
Calculates the Money flow index and returns its value.
|
double |
iMomentum(String symbol,
Timeframe timeframe,
int period,
AppliedPrice appliedPrice,
int shift)
Calculates the Momentum indicator and returns its value.
|
double |
iOBV(String symbol,
Timeframe timeframe,
AppliedPrice appliedPrice,
int shift)
Calculates the On Balance Volume indicator and returns its value.
|
double |
iOpen(String symbol,
Timeframe timeframe,
int shift)
Returns Open value for the bar of indicated symbol with timeframe and shift.
|
double |
iOsMA(String symbol,
Timeframe timeframe,
int fastEMAPeriod,
int slowEMAPeriod,
int signalPeriod,
AppliedPrice appliedPrice,
int shift)
Calculates the Moving Average of Oscillator and returns its value.
|
double |
iRSI(String symbol,
Timeframe timeframe,
int period,
AppliedPrice appliedPrice,
int shift)
Calculates the Relative strength index and returns its value.
|
double |
iRVI(String symbol,
Timeframe timeframe,
int period,
MACDIndicatorLines mode,
int shift)
Calculates the Relative Vigor index and returns its value.
|
double |
iSAR(String symbol,
Timeframe timeframe,
double step,
double maximum,
int shift)
Calculates the Parabolic Stop and Reverse system and returns its value.
|
boolean |
isConnected()
The function returns the status of the main connection between client terminal and server that performs data pumping.
|
boolean |
isConnectedToTerminal() |
boolean |
IsConnectedToTerminal() |
boolean |
isDemo()
Returns TRUE if the expert runs on a demo account, otherwise returns FALSE.
|
boolean |
isDllsAllowed()
Returns TRUE if the function DLL call is allowed for the expert, otherwise returns FALSE.
|
boolean |
isExpertEnabled()
Returns TRUE if expert advisors are enabled for running, otherwise returns FALSE.
|
boolean |
isLibrariesAllowed()
Returns TRUE if the expert can call library function, otherwise returns FALSE.
|
boolean |
isOptimization()
Returns TRUE if expert runs in the strategy tester optimization mode, otherwise returns FALSE.
|
boolean |
isStopped()
Returns TRUE if the program (an expert or a script) has been commanded to stop its operation, otherwise returns FALSE.
|
double |
iStdDev(String symbol,
Timeframe timeframe,
int maPeriod,
int maShift,
MovingAverageMethod maMethod,
AppliedPrice appliedPrice,
int shift)
Calculates the Standard Deviation indicator and returns its value.
|
boolean |
isTesting()
Returns TRUE if expert runs in the testing mode, otherwise returns FALSE.
|
double |
iStochastic(String symbol,
Timeframe timeframe,
int kPeriod,
int dPeriod,
int slowing,
MovingAverageMethod maMethod,
int priceField,
MACDIndicatorLines mode,
int shift)
Calculates the Stochastic oscillator and returns its value.
|
boolean |
isTradeAllowed()
Returns TRUE if the expert is allowed to trade and a thread for trading is not occupied, otherwise returns FALSE.
|
boolean |
isTradeContextBusy()
Returns TRUE if a thread for trading is occupied by another expert advisor, otherwise returns FALSE.
|
boolean |
isVisualMode()
Returns TRUE if the expert is tested with checked 'Visual Mode' button, otherwise returns FALSE.
|
Date |
iTime(String symbol,
Timeframe timeframe,
int shift)
Returns Time value for the bar of indicated symbol with timeframe and shift.
|
double |
iVolume(String symbol,
Timeframe timeframe,
int shift)
Returns Tick Volume value for the bar of indicated symbol with timeframe and shift.
|
double |
iWPR(String symbol,
Timeframe timeframe,
int period,
int shift)
Calculates the Larry William's percent range indicator and returns its value.
|
Date |
marketInfo_MODE_TIME(String symbol)
Returns the The last incoming tick time (last known server time).
|
MarketInformation |
marketInfo(String symbol)
Returns all market variables for the specified.
|
double |
marketInfo(String symbol,
MarketInfo type) |
int |
messageBox(String text,
String caption,
int flags)
The MessageBox function creates, displays, and operates message box.
|
int |
minute()
Returns the current minute (0,1,2,..59) of the last known server time by the moment of the program start (this value will not change within the time of the program execution).
|
int |
month()
Returns the current month as number (1-January,2,3,4,5,6,7,8,9,10,11,12), i.e., the number of month of the last known server time.
|
PositionInfo |
newPosition(PositionInfo prevPositionInfo)
Returns information about new, modified, closed or deleted orders.
|
TickInfo |
newTick(String symbol,
TickInfo lastTick)
Returns new tick information (time,bid,ask,orders P/L) for the specified symbol.
|
boolean |
objectCreate(String name,
ObjectType type,
int window,
Date time1,
double price1)
Creation of an object with the specified name, type and initial coordinates in the specified window.
|
boolean |
objectCreate(String name,
ObjectType type,
int window,
Date time1,
double price1,
Date time2,
double price2)
Creation of an object with the specified name, type and initial coordinates in the specified window.
|
boolean |
objectCreate(String name,
ObjectType type,
int window,
Date time1,
double price1,
Date time2,
double price2,
Date time3,
double price3)
Creation of an object with the specified name, type and initial coordinates in the specified window.
|
boolean |
objectDelete(String name)
Deletes object having the specified name.
|
String |
objectDescription(String name)
Return object description.
|
int |
objectFind(String name)
Search for an object having the specified name.
|
double |
objectGet(String name,
ObjectProperty index)
The function returns the value of the specified object property.
|
String |
objectGetFiboDescription(String name,
int index)
The function returns the level description of a Fibonacci object.
|
int |
objectGetShiftByValue(String name,
double value)
The function calculates and returns bar index (shift related to the current bar) for the given price.
|
double |
objectGetValueByShift(String name,
int shift)
The function calculates and returns the price value for the specified bar (shift related to the current bar).
|
boolean |
objectMove(String name,
int point,
Date time1,
double price1)
The function moves an object coordinate in the chart.
|
String |
objectName(int index)
The function returns the object name by its index in the objects list.
|
int |
objectsDeleteAll(int window,
int type)
Removes all objects of the specified type and in the specified sub-window of the chart.
|
boolean |
objectSet(String name,
ObjectProperty index,
double value)
Changes the value of the specified object property.
|
boolean |
objectSetFiboDescription(String name,
int index,
String text)
The function assigns a new description to a level of a Fibonacci object.
|
boolean |
objectSetText(String name,
String text,
int font_size,
String font,
long text_color)
Changes the object description.
|
int |
objectsTotal(ObjectType type)
Returns total amount of objects of the specified type in the chart.
|
int |
objectType(String name)
The function returns the object type value.
|
boolean |
orderClose(int ticket,
double lots,
double price,
int slippage,
long arrowColor)
Closes opened order.
|
boolean |
orderCloseBy(int ticket,
int opposite,
long arrowColor)
Closes an opened order by another opposite opened order.
|
double |
orderClosePrice()
Returns close price for the currently selected order.
|
Date |
orderCloseTime()
Returns close time for the currently selected order.
|
String |
orderComment()
Returns comment for the selected order.
|
double |
orderCommission()
Returns calculated commission for the currently selected order.
|
boolean |
orderDelete(int ticket,
long arrowColor)
Deletes previously opened pending order.
|
Date |
orderExpiration()
Returns expiration date for the selected pending order.
|
OrderInfo |
orderGet(int index,
SelectionType select,
SelectionPool pool)
The function selects available information about the order.
|
double |
orderLots()
Returns amount of lots for the selected order.
|
int |
orderMagicNumber()
Returns an identifying (magic) number for the currently selected order.
|
boolean |
orderModify(int ticket,
double price,
double stoploss,
double takeprofit,
Date expiration,
long arrowColor)
Modification of characteristics for the previously opened position or pending orders.
|
double |
orderOpenPrice()
Returns open price for the currently selected order.
|
Date |
orderOpenTime()
Returns open time for the currently selected order.
|
void |
orderPrint()
Prints information about the selected order in the log in the following format: ticket number; open time; trade operation; amount of lots; open price; Stop Loss; Take Profit; close time; close price; commission; swap; profit; comment; magic number; pending order expiration date.
|
double |
orderProfit()
Returns the net profit value (without swaps or commissions) for the selected order.
|
boolean |
orderSelect(int index,
SelectionType select,
SelectionPool pool)
The function selects an order for further processing.
|
int |
orderSend(String symbol,
TradeOperation cmd,
double volume,
double price,
int slippage,
double stoploss,
double takeprofit,
String comment,
int magic,
Date expiration,
long arrowColor)
The main function used to open a position or place a pending order.
|
int |
ordersHistoryTotal()
Returns the number of closed orders in the account history loaded into the terminal.
|
double |
orderStopLoss()
Returns stop loss value for the currently selected order.
|
int |
ordersTotal()
Returns market and pending orders count.
|
double |
orderSwap()
Returns swap value for the currently selected order.
|
String |
orderSymbol()
Returns the order symbol value for selected order.
|
double |
orderTakeProfit()
Returns take profit value for the currently selected order.
|
int |
orderTicket()
Returns ticket number for the currently selected order.
|
int |
orderType()
Returns order operation type for the currently selected order.
|
int |
period()
Returns the amount of minutes determining the used period (chart timeframe).
|
void |
playSound(String filename)
Function plays a sound file.
|
void |
print(String comments)
Prints a message to the experts log
|
boolean |
refreshRates()
Refreshing of data in pre-defined variables and series arrays.
|
int |
seconds()
Returns the amount of seconds elapsed from the beginning of the current minute of the last known server time by the moment of the program start (this value will not change within the time of the program execution).
|
void |
setAutoRefreshRates(boolean autoRefreshRates)
The system calls RefreshRates() automatically before each MT4 method, - you can change this behaviour by setting autoRefresh to false.
|
void |
setOrdersProcessingChannel(StrategyRunner strategyRunner) |
void |
setStrategyRunner(StrategyRunner strategyRunner) |
String |
symbol()
Returns a text string with the name of the current financial instrument.
|
String |
terminalCompany()
Returns the name of company owning the client terminal.
|
String |
terminalName()
Returns client terminal name.
|
String |
terminalPath()
Returns the directory, from which the client terminal was launched.
|
Date |
timeCurrent()
Returns the last known server time (time of incoming of the latest quote) as number of seconds elapsed from 00:00 January 1, 1970.
|
Date |
toDate(double dTime) |
int |
uninitializeReason()
Returns the code of the uninitialization reason for the experts, custom indicators, and scripts.
|
int |
windowBarsPerChart()
Function returns the amount of bars visible on the chart.
|
String |
windowExpertName()
Returns name of the executed expert, script, custom indicator, or library, depending on the MQL4 program, from which this function has been called.
|
int |
windowFind(String name)
If indicator with name was found, the function returns the window index containing this specified indicator, otherwise it returns -1.
|
int |
windowFirstVisibleBar()
The function returns the first visible bar number in the current chart window.
|
int |
windowHandle(String symbol,
Timeframe timeframe)
Returns the system window handler containing the given chart.
|
boolean |
windowIsVisible(int index)
Returns TRUE if the chart subwindow is visible, otherwise returns FALSE.
|
int |
windowOnDropped()
Returns window index where expert, custom indicator or script was dropped.
|
double |
windowPriceMax(int index)
Returns maximal value of the vertical scale of the specified subwindow of the current chart (0-main chart window, the indicators' subwindows are numbered starting from 1).
|
double |
windowPriceMin(int index)
Returns minimal value of the vertical scale of the specified subwindow of the current chart (0-main chart window, the indicators' subwindows are numbered starting from 1).
|
double |
windowPriceOnDropped()
Returns the price part of the chart point where expert or script was dropped.
|
void |
windowRedraw()
Redraws the current chart forcedly.
|
boolean |
windowScreenShot(String filename,
int sizeX,
int sizeY,
int startBar,
int chartScale,
int chartMode)
Saves current chart screen shot as a GIF file.
|
int |
windowsTotal()
Returns count of indicator windows on the chart (including main chart).
|
Date |
windowTimeOnDropped()
Returns the time part of the chart point where expert or script was dropped.
|
int |
windowXOnDropped()
Returns the value at X axis in pixels for the chart window client area point at which the expert or script was dropped.
|
int |
windowYOnDropped()
Returns the value at Y axis in pixels for the chart window client area point at which the expert or script was dropped.
|
int |
year()
Returns the current year, i.e., the year of the last known server time.
|
public static final char ARG_BEGIN
public static final char ARG_END
public static final int PROTO
public boolean IsConnectedToTerminal()
public boolean isConnectedToTerminal()
public void setStrategyRunner(StrategyRunner strategyRunner)
public void setOrdersProcessingChannel(StrategyRunner strategyRunner)
public StrategyRunner getStrategyRunner()
public Date marketInfo_MODE_TIME(String symbol) throws ErrUnknownSymbol
ErrUnknownSymbolpublic Date toDate(double dTime)
public int fromDate(Date dTime)
public void setAutoRefreshRates(boolean autoRefreshRates)
autoRefreshRates - true|falsepublic MarketInformation marketInfo(String symbol) throws ErrUnknownSymbol
symbol - ErrUnknownSymbolpublic TickInfo newTick(String symbol, TickInfo lastTick) throws ErrUnknownSymbol
symbol - lastTick - ErrUnknownSymbolpublic OrderInfo orderGet(int index, SelectionType select, SelectionPool pool)
index - Order index or order ticket depending on the second parameter.select - Selecting flags. It can be any of the following values: SELECT_BY_POS - index in the order pool, SELECT_BY_TICKET - index is order ticket.pool - Optional order pool index. Used when the selected parameter is SELECT_BY_POS. It can be any of the following values: MODE_TRADES (default)- order selected from trading pool(opened and pending orders), MODE_HISTORY - order selected from history pool (closed and canceled order).null if the function fails.public PositionInfo newPosition(PositionInfo prevPositionInfo)
prevPositionInfo - position information to base modifications calculatation atpublic int iBars(String symbol, Timeframe timeframe) throws ErrHistoryWillUpdated, ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.ErrHistoryWillUpdatedErrUnknownSymbolpublic int iBarShift(String symbol, Timeframe timeframe, Date time, boolean exact) throws ErrIncorrectSeriesarrayUsing, ErrUnknownSymbol, ErrHistoryWillUpdated
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.time - value to find (bar's open time).exact - Return mode when bar not found. false - iBarShift returns nearest. true - iBarShift returns -1.ErrIncorrectSeriesarrayUsingErrUnknownSymbolErrHistoryWillUpdatedpublic double iClose(String symbol, Timeframe timeframe, int shift) throws ErrHistoryWillUpdated, ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrHistoryWillUpdatedErrUnknownSymbolpublic double iHigh(String symbol, Timeframe timeframe, int shift) throws ErrHistoryWillUpdated, ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrHistoryWillUpdatedErrUnknownSymbolpublic double iLow(String symbol, Timeframe timeframe, int shift) throws ErrHistoryWillUpdated, ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrHistoryWillUpdatedErrUnknownSymbolpublic double iOpen(String symbol, Timeframe timeframe, int shift) throws ErrHistoryWillUpdated, ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrHistoryWillUpdatedErrUnknownSymbolpublic double iVolume(String symbol, Timeframe timeframe, int shift) throws ErrHistoryWillUpdated, ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrHistoryWillUpdatedErrUnknownSymbolpublic Date iTime(String symbol, Timeframe timeframe, int shift) throws ErrHistoryWillUpdated, ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrHistoryWillUpdatedErrUnknownSymbolpublic int iLowest(String symbol, Timeframe timeframe, Series type, int count, int start) throws ErrIncorrectSeriesarrayUsing, ErrHistoryWillUpdated, ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.type - Series array identifier. It can be any of Series array identifier enumeration values.count - Number of periods (in direction from the start bar to the back one) on which the calculation is carried out.start - Shift showing the bar, relative to the current bar, that the data should be taken from.ErrIncorrectSeriesarrayUsingErrHistoryWillUpdatedErrUnknownSymbolpublic int iHighest(String symbol, Timeframe timeframe, Series type, int count, int start) throws ErrIncorrectSeriesarrayUsing, ErrHistoryWillUpdated, ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.type - Series array identifier. It can be any of Series array identifier enumeration values.count - Number of periods (in direction from the start bar to the back one) on which the calculation is carried out.start - Shift showing the bar, relative to the current bar, that the data should be taken from.ErrIncorrectSeriesarrayUsingErrHistoryWillUpdatedErrUnknownSymbolpublic double accountBalance()
public double accountCredit()
public String accountCompany()
public String accountCurrency()
public double accountEquity()
public double accountFreeMargin()
public double accountMargin()
public String accountName()
public int accountNumber()
public double accountProfit()
public int getLastError()
public boolean isConnected()
public boolean isDemo()
public boolean isTesting()
public boolean isVisualMode()
public int getTickCount()
public void comment(String comments)
comments - User defined comment.public double marketInfo(String symbol, MarketInfo type) throws ErrUnknownSymbol
symbol - type - ErrUnknownSymbolpublic void print(String comments)
comments - User defined message.public int day()
public int dayOfWeek()
public int dayOfYear()
public int hour()
public int minute()
public int month()
public int seconds()
public Date timeCurrent()
public int year()
public boolean objectCreate(String name, ObjectType type, int window, Date time1, double price1, Date time2, double price2, Date time3, double price3)
name - Object unique name.type - Object type. It can be any of the Object type enumeration values.window - Index of the window where the object will be added. Window index must exceed or equal to 0 and be less than WindowsTotal().time1 - Time part of the first point.price1 - Price part of the first point.time2 - Time part of the second point.price2 - Price part of the second point.time3 - Time part of the third point.price3 - Price part of the third point.public boolean objectCreate(String name, ObjectType type, int window, Date time1, double price1)
name - Object unique name.type - Object type. It can be any of the Object type enumeration values.window - Index of the window where the object will be added. Window index must exceed or equal to 0 and be less than WindowsTotal().time1 - Time part of the first point.price1 - Price part of the first point.public boolean objectCreate(String name, ObjectType type, int window, Date time1, double price1, Date time2, double price2)
name - Object unique name.type - Object type. It can be any of the Object type enumeration values.window - Index of the window where the object will be added. Window index must exceed or equal to 0 and be less than WindowsTotal().time1 - Time part of the first point.price1 - Price part of the first point.time2 - Time part of the second point.price2 - Price part of the second point.public boolean objectDelete(String name)
name - Object unique name.public double objectGet(String name, ObjectProperty index)
name - Object unique name.index - Object property index. It can be any of the Object properties enumeration values.public boolean objectSet(String name, ObjectProperty index, double value)
name - Object unique name.index - Object property index. It can be any of the Object properties enumeration values.value - New value of the given property.public String objectGetFiboDescription(String name, int index)
name - Object unique name.index - Index of the Fibonacci level (0-31).public boolean objectSetFiboDescription(String name, int index, String text)
name - Object unique name.index - Index of the Fibonacci level (0-31).text - New description of the level.public boolean objectSetText(String name, String text, int font_size, String font, long text_color)
name - Object unique name.text - A text describing the object.font_size - Font size in points.font - Font name (NULL).text_color - Text color (CLR_NONE).public int objectsTotal(ObjectType type)
type - Optional parameter. An object type to be counted. It can be any of the Object type enumeration values or EMPTY constant to count all objects with any types.public int objectType(String name)
name - Object unique name.public double iAC(String symbol, Timeframe timeframe, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iAD(String symbol, Timeframe timeframe, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iAlligator(String symbol, Timeframe timeframe, int jawPeriod, int jawShift, int teethPeriod, int teethShift, int lipsPeriod, int lipsShift, MovingAverageMethod maMethod, AppliedPrice appliedPrice, GatorMode mode, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.jawPeriod - Blue line averaging period (Alligator's Jaw).jawShift - Blue line shift relative to the chart.teethPeriod - Red line averaging period (Alligator's Teeth).teethShift - Red line shift relative to the chart.lipsPeriod - Green line averaging period (Alligator's Lips).lipsShift - Green line shift relative to the chart.maMethod - MA method. It can be any of Moving Average methods.appliedPrice - Applied price. It can be any of Applied price enumeration values.mode - Data source, identifier of a line of the indicator. It can be any of the following values: MODE_GATORJAW - Gator Jaw (blue) balance line, MODE_GATORTEETH - Gator Teeth (red) balance line, MODE_GATORLIPS - Gator Lips (green) balance line.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iADX(String symbol, Timeframe timeframe, int period, AppliedPrice appliedPrice, ADXIndicatorLines mode, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.appliedPrice - Applied price. It can be any of Applied price enumeration values.mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iATR(String symbol, Timeframe timeframe, int period, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iAO(String symbol, Timeframe timeframe, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iBearsPower(String symbol, Timeframe timeframe, int period, AppliedPrice appliedPrice, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.appliedPrice - Applied price. It can be any of Applied price enumeration values.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iBands(String symbol, Timeframe timeframe, int period, int deviation, int bandsShift, AppliedPrice appliedPrice, BandsIndicatorLines mode, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.deviation - Deviation from the main line.bandsShift - The indicator shift relative to the chart.appliedPrice - Applied price. It can be any of Applied price enumeration values.mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iBullsPower(String symbol, Timeframe timeframe, int period, AppliedPrice appliedPrice, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.appliedPrice - Applied price. It can be any of Applied price enumeration values.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iCCI(String symbol, Timeframe timeframe, int period, AppliedPrice appliedPrice, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.appliedPrice - Applied price. It can be any of Applied price enumeration values.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iCustom(String symbol, Timeframe timeframe, String name, int mode, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.name - Custom indicator compiled program name.mode - Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iCustom(String symbol, Timeframe timeframe, String name, int mode, int shift, String... params) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.name - Custom indicator compiled program name.mode - Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).params - Parameters set (if necessary). The passed parameters and their order must correspond with the desclaration order and the type of extern variables of the custom indicator.ErrUnknownSymbolpublic double iCustom(String symbol, Timeframe timeframe, String name, int mode, int shift, int... params) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.name - Custom indicator compiled program name.mode - Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).params - Parameters set (if necessary). The passed parameters and their order must correspond with the desclaration order and the type of extern variables of the custom indicator.ErrUnknownSymbolpublic double iCustom(String symbol, Timeframe timeframe, String name, int mode, int shift, double... params) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.name - Custom indicator compiled program name.mode - Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).params - Parameters set (if necessary). The passed parameters and their order must correspond with the desclaration order and the type of extern variables of the custom indicator.ErrUnknownSymbolpublic double iDeMarker(String symbol, Timeframe timeframe, int period, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iEnvelopes(String symbol, Timeframe timeframe, int maPeriod, MovingAverageMethod maMethod, int maShitf, AppliedPrice appliedPrice, double deviation, BandsIndicatorLines mode, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.maPeriod - Averaging period for calculation of the main line.maMethod - MA method. It can be any of Moving Average methods.maShitf - MA shift. Indicator line offset relate to the chart by timeframe.appliedPrice - Applied price. It can be any of Applied price enumeration values.deviation - Percent deviation from the main line.mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iForce(String symbol, Timeframe timeframe, int period, MovingAverageMethod maMethod, AppliedPrice appliedPrice, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.maMethod - MA method. It can be any of Moving Average methods.appliedPrice - Applied price. It can be any of Applied price enumeration values.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iFractals(String symbol, Timeframe timeframe, BandsIndicatorLines mode, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iGator(String symbol, Timeframe timeframe, int jawPeriod, int jawShift, int teethPeriod, int teethShift, int lipsPeriod, int lipsShift, MovingAverageMethod maMethod, AppliedPrice appliedPrice, BandsIndicatorLines mode, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.jawPeriod - Blue line averaging period (Alligator's Jaw).jawShift - Blue line shift relative to the chart.teethPeriod - Red line averaging period (Alligator's Teeth).teethShift - Red line shift relative to the chart.lipsPeriod - Green line averaging period (Alligator's Lips).lipsShift - Green line shift relative to the chart.maMethod - MA method. It can be any of Moving Average methods.appliedPrice - Applied price. It can be any of Applied price enumeration values.mode - Indicator line index. It can be any of Indicators line identifiers enumeration value.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iBWMFI(String symbol, Timeframe timeframe, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iMomentum(String symbol, Timeframe timeframe, int period, AppliedPrice appliedPrice, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.appliedPrice - Applied price. It can be any of Applied price enumeration values.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iMFI(String symbol, Timeframe timeframe, int period, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iMA(String symbol, Timeframe timeframe, int period, int maShift, MovingAverageMethod maMethod, AppliedPrice appliedPrice, int shift) throws ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.maShift - MA shift. Indicators line offset relate to the chart by timeframe.maMethod - MA method. It can be any of the Moving Average method enumeration value.appliedPrice - Applied price. It can be any of Applied price enumeration values.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iOsMA(String symbol, Timeframe timeframe, int fastEMAPeriod, int slowEMAPeriod, int signalPeriod, AppliedPrice appliedPrice, int shift) throws ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.fastEMAPeriod - Number of periods for fast moving average calculation.slowEMAPeriod - Number of periods for slow moving average calculation.signalPeriod - Number of periods for signal moving average calculation.appliedPrice - Applied price. It can be any of Applied price enumeration values.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iMACD(String symbol, Timeframe timeframe, int fastEMAPeriod, int slowEMAPeriod, int signalPeriod, AppliedPrice appliedPrice, MACDIndicatorLines mode, int shift) throws ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.fastEMAPeriod - Number of periods for fast moving average calculation.slowEMAPeriod - Number of periods for slow moving average calculation.signalPeriod - Number of periods for signal moving average calculation.appliedPrice - Applied price. It can be any of Applied price enumeration values.mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iOBV(String symbol, Timeframe timeframe, AppliedPrice appliedPrice, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.appliedPrice - Applied price. It can be any of Applied price enumeration values.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iSAR(String symbol, Timeframe timeframe, double step, double maximum, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.step - Increment, usually 0.02.maximum - Maximum value, usually 0.2.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iRSI(String symbol, Timeframe timeframe, int period, AppliedPrice appliedPrice, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Number of periods for calculation.appliedPrice - Applied price. It can be any of Applied price enumeration values.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iRVI(String symbol, Timeframe timeframe, int period, MACDIndicatorLines mode, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Number of periods for calculation.mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iStdDev(String symbol, Timeframe timeframe, int maPeriod, int maShift, MovingAverageMethod maMethod, AppliedPrice appliedPrice, int shift) throws ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.maPeriod - MA periodmaShift - MA shift. Indicators line offset relate to the chart by timeframe.maMethod - MA method. It can be any of the Moving Average method enumeration value.appliedPrice - Applied price. It can be any of Applied price enumeration values.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iStochastic(String symbol, Timeframe timeframe, int kPeriod, int dPeriod, int slowing, MovingAverageMethod maMethod, int priceField, MACDIndicatorLines mode, int shift) throws ErrUnknownSymbol
symbol - Symbol the data of which should be used to calculate indicator; NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.kPeriod - %K line period.dPeriod - %D line period.slowing - Slowing value.maMethod - MA method. It can be any of the Moving Average method enumeration value.priceField - Price field parameter. Can be one of this values: 0 - Low/High or 1 - Close/Close.mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic double iWPR(String symbol, Timeframe timeframe, int period, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.period - Averaging period for calculation.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic boolean orderClose(int ticket,
double lots,
double price,
int slippage,
long arrowColor)
throws ErrCustomIndicatorError,
ErrIntegerParameterExpected,
ErrInvalidFunctionParamvalue,
ErrInvalidPriceParam,
ErrInvalidTicket,
ErrUnknownSymbol,
ErrTradeNotAllowed,
ErrCommonError,
ErrInvalidTradeParameters,
ErrServerBusy,
ErrOldVersion,
ErrNoConnection,
ErrTooFrequentRequests,
ErrAccountDisabled,
ErrInvalidAccount,
ErrTradeTimeout,
ErrInvalidPrice,
ErrInvalidStops,
ErrInvalidTradeVolume,
ErrMarketClosed,
ErrTradeDisabled,
ErrNotEnoughMoney,
ErrPriceChanged,
ErrOffQuotes,
ErrRequote,
ErrOrderLocked,
ErrLongPositionsOnlyAllowed,
ErrTooManyRequests,
ErrTradeTimeout2,
ErrTradeTimeout3,
ErrTradeTimeout4,
ErrTradeModifyDenied,
ErrTradeContextBusy,
ErrTradeExpirationDenied,
ErrTradeTooManyOrders
ticket - Unique number of the order ticket.lots - Number of lots.price - Preferred closing price.slippage - Value of the maximum price slippage in points.arrowColor - Color of the closing arrow on the chart. If the parameter is missing or has CLR_NONE value closing arrow will not be drawn on the chart.ErrCustomIndicatorErrorErrIntegerParameterExpectedErrInvalidFunctionParamvalueErrInvalidPriceParamErrInvalidTicketErrUnknownSymbolErrTradeNotAllowedErrCommonErrorErrInvalidTradeParametersErrServerBusyErrOldVersionErrNoConnectionErrTooFrequentRequestsErrAccountDisabledErrInvalidAccountErrTradeTimeoutErrInvalidPriceErrInvalidStopsErrInvalidTradeVolumeErrMarketClosedErrTradeDisabledErrNotEnoughMoneyErrPriceChangedErrOffQuotesErrRequoteErrOrderLockedErrLongPositionsOnlyAllowedErrTooManyRequestsErrTradeTimeout2ErrTradeTimeout3ErrTradeTimeout4ErrTradeModifyDeniedErrTradeContextBusyErrTradeExpirationDeniedErrTradeTooManyOrderspublic boolean orderCloseBy(int ticket,
int opposite,
long arrowColor)
throws ErrCustomIndicatorError,
ErrIntegerParameterExpected,
ErrInvalidFunctionParamvalue,
ErrInvalidTicket,
ErrUnknownSymbol,
ErrTradeNotAllowed,
ErrCommonError,
ErrInvalidTradeParameters,
ErrServerBusy,
ErrOldVersion,
ErrNoConnection,
ErrTooFrequentRequests,
ErrAccountDisabled,
ErrInvalidAccount,
ErrTradeTimeout,
ErrInvalidPrice,
ErrInvalidStops,
ErrInvalidTradeVolume,
ErrMarketClosed,
ErrTradeDisabled,
ErrNotEnoughMoney,
ErrPriceChanged,
ErrOffQuotes,
ErrRequote,
ErrOrderLocked,
ErrLongPositionsOnlyAllowed,
ErrTooManyRequests,
ErrTradeTimeout2,
ErrTradeTimeout3,
ErrTradeTimeout4,
ErrTradeModifyDenied,
ErrTradeContextBusy,
ErrTradeExpirationDenied,
ErrTradeTooManyOrders
ticket - Unique number of the order ticket.opposite - Unique number of the opposite order ticket.arrowColor - Color of the closing arrow on the chart. If the parameter is missing or has CLR_NONE value closing arrow will not be drawn on the chart.ErrCustomIndicatorErrorErrIntegerParameterExpectedErrInvalidFunctionParamvalueErrInvalidTicketErrUnknownSymbolErrTradeNotAllowedErrCommonErrorErrInvalidTradeParametersErrServerBusyErrOldVersionErrNoConnectionErrTooFrequentRequestsErrAccountDisabledErrInvalidAccountErrTradeTimeoutErrInvalidPriceErrInvalidStopsErrInvalidTradeVolumeErrMarketClosedErrTradeDisabledErrNotEnoughMoneyErrPriceChangedErrOffQuotesErrRequoteErrOrderLockedErrLongPositionsOnlyAllowedErrTooManyRequestsErrTradeTimeout2ErrTradeTimeout3ErrTradeTimeout4ErrTradeModifyDeniedErrTradeContextBusyErrTradeExpirationDeniedErrTradeTooManyOrderspublic double orderClosePrice()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic Date orderCloseTime() throws ErrNoOrderSelected
ErrNoOrderSelectedpublic String orderComment() throws ErrNoOrderSelected
ErrNoOrderSelectedpublic double orderCommission()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic boolean orderDelete(int ticket,
long arrowColor)
throws ErrCustomIndicatorError,
ErrInvalidFunctionParamvalue,
ErrInvalidTicket,
ErrUnknownSymbol,
ErrTradeNotAllowed,
ErrCommonError,
ErrInvalidTradeParameters,
ErrServerBusy,
ErrOldVersion,
ErrNoConnection,
ErrTooFrequentRequests,
ErrAccountDisabled,
ErrInvalidAccount,
ErrTradeTimeout,
ErrInvalidPrice,
ErrInvalidStops,
ErrInvalidTradeVolume,
ErrMarketClosed,
ErrTradeDisabled,
ErrNotEnoughMoney,
ErrPriceChanged,
ErrOffQuotes,
ErrRequote,
ErrOrderLocked,
ErrLongPositionsOnlyAllowed,
ErrTooManyRequests,
ErrTradeTimeout2,
ErrTradeTimeout3,
ErrTradeTimeout4,
ErrTradeModifyDenied,
ErrTradeContextBusy,
ErrTradeExpirationDenied,
ErrTradeTooManyOrders
ticket - Unique number of the order ticket.arrowColor - Color of the arrow on the chart. If the parameter is missing or has CLR_NONE value closing arrow will not be drawn on the chart.ErrCustomIndicatorErrorErrInvalidFunctionParamvalueErrInvalidTicketErrUnknownSymbolErrTradeNotAllowedErrCommonErrorErrInvalidTradeParametersErrServerBusyErrOldVersionErrNoConnectionErrTooFrequentRequestsErrAccountDisabledErrInvalidAccountErrTradeTimeoutErrInvalidPriceErrInvalidStopsErrInvalidTradeVolumeErrMarketClosedErrTradeDisabledErrNotEnoughMoneyErrPriceChangedErrOffQuotesErrRequoteErrOrderLockedErrLongPositionsOnlyAllowedErrTooManyRequestsErrTradeTimeout2ErrTradeTimeout3ErrTradeTimeout4ErrTradeModifyDeniedErrTradeContextBusyErrTradeExpirationDeniedErrTradeTooManyOrderspublic Date orderExpiration() throws ErrNoOrderSelected
ErrNoOrderSelectedpublic double orderLots()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic int orderMagicNumber()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic boolean orderModify(int ticket,
double price,
double stoploss,
double takeprofit,
Date expiration,
long arrowColor)
throws ErrCustomIndicatorError,
ErrIntegerParameterExpected,
ErrInvalidFunctionParamvalue,
ErrInvalidPriceParam,
ErrInvalidTicket,
ErrUnknownSymbol,
ErrTradeNotAllowed,
ErrNoResult,
ErrCommonError,
ErrInvalidTradeParameters,
ErrServerBusy,
ErrOldVersion,
ErrNoConnection,
ErrTooFrequentRequests,
ErrAccountDisabled,
ErrInvalidAccount,
ErrTradeTimeout,
ErrInvalidPrice,
ErrInvalidStops,
ErrInvalidTradeVolume,
ErrMarketClosed,
ErrTradeDisabled,
ErrNotEnoughMoney,
ErrPriceChanged,
ErrOffQuotes,
ErrRequote,
ErrOrderLocked,
ErrLongPositionsOnlyAllowed,
ErrTooManyRequests,
ErrTradeTimeout2,
ErrTradeTimeout3,
ErrTradeTimeout4,
ErrTradeModifyDenied,
ErrTradeContextBusy,
ErrTradeExpirationDenied,
ErrTradeTooManyOrders
ticket - Unique number of the order ticket.price - New open price of the pending order.stoploss - New StopLoss level.takeprofit - New TakeProfit level.expiration - Pending order expiration time.arrowColor - Color of the arrow on the chart. If the parameter is missing or has CLR_NONE value closing arrow will not be drawn on the chart.ErrCustomIndicatorErrorErrIntegerParameterExpectedErrInvalidFunctionParamvalueErrInvalidPriceParamErrInvalidTicketErrUnknownSymbolErrTradeNotAllowedErrNoResultErrCommonErrorErrInvalidTradeParametersErrServerBusyErrOldVersionErrNoConnectionErrTooFrequentRequestsErrAccountDisabledErrInvalidAccountErrTradeTimeoutErrInvalidPriceErrInvalidStopsErrInvalidTradeVolumeErrMarketClosedErrTradeDisabledErrNotEnoughMoneyErrPriceChangedErrOffQuotesErrRequoteErrOrderLockedErrLongPositionsOnlyAllowedErrTooManyRequestsErrTradeTimeout2ErrTradeTimeout3ErrTradeTimeout4ErrTradeModifyDeniedErrTradeContextBusyErrTradeExpirationDeniedErrTradeTooManyOrderspublic double orderOpenPrice()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic Date orderOpenTime() throws ErrNoOrderSelected
ErrNoOrderSelectedpublic void orderPrint()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic double orderProfit()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic boolean orderSelect(int index,
SelectionType select,
SelectionPool pool)
index - Order index or order ticket depending on the second parameter.select - Selecting flags. It can be any of the following values: SELECT_BY_POS - index in the order pool, SELECT_BY_TICKET - index is order ticket.pool - Optional order pool index. Used when the selected parameter is SELECT_BY_POS. It can be any of the following values: MODE_TRADES (default)- order selected from trading pool(opened and pending orders), MODE_HISTORY - order selected from history pool (closed and canceled order).public int orderSend(String symbol, TradeOperation cmd, double volume, double price, int slippage, double stoploss, double takeprofit, String comment, int magic, Date expiration, long arrowColor) throws ErrInvalidFunctionParamvalue, ErrCustomIndicatorError, ErrStringParameterExpected, ErrIntegerParameterExpected, ErrUnknownSymbol, ErrInvalidPriceParam, ErrTradeNotAllowed, ErrLongsNotAllowed, ErrShortsNotAllowed, ErrCommonError, ErrInvalidTradeParameters, ErrServerBusy, ErrOldVersion, ErrNoConnection, ErrTooFrequentRequests, ErrAccountDisabled, ErrInvalidAccount, ErrTradeTimeout, ErrInvalidPrice, ErrInvalidStops, ErrInvalidTradeVolume, ErrMarketClosed, ErrTradeDisabled, ErrNotEnoughMoney, ErrPriceChanged, ErrOffQuotes, ErrRequote, ErrOrderLocked, ErrLongPositionsOnlyAllowed, ErrTooManyRequests, ErrTradeTimeout2, ErrTradeTimeout3, ErrTradeTimeout4, ErrTradeModifyDenied, ErrTradeContextBusy, ErrTradeExpirationDenied, ErrTradeTooManyOrders
symbol - Symbol for trading.cmd - Operation type. It can be any of the Trade operation enumeration.volume - Number of lots.price - Preferred price of the trade.slippage - Maximum price slippage for buy or sell orders in points.stoploss - StopLoss level.takeprofit - TakeProfit level.comment - Order comment text. Last part of the comment may be changed by server.magic - Order magic number. May be used as user defined identifier.expiration - Order expiration time (for pending orders only).arrowColor - Color of the arrow on the chart. If the parameter is missing or has CLR_NONE value closing arrow will not be drawn on the chart.ErrInvalidFunctionParamvalueErrCustomIndicatorErrorErrStringParameterExpectedErrIntegerParameterExpectedErrUnknownSymbolErrInvalidPriceParamErrTradeNotAllowedErrLongsNotAllowedErrShortsNotAllowedErrCommonErrorErrInvalidTradeParametersErrServerBusyErrOldVersionErrNoConnectionErrTooFrequentRequestsErrAccountDisabledErrInvalidAccountErrTradeTimeoutErrInvalidPriceErrInvalidStopsErrInvalidTradeVolumeErrMarketClosedErrTradeDisabledErrNotEnoughMoneyErrPriceChangedErrOffQuotesErrRequoteErrOrderLockedErrLongPositionsOnlyAllowedErrTooManyRequestsErrTradeTimeout2ErrTradeTimeout3ErrTradeTimeout4ErrTradeModifyDeniedErrTradeContextBusyErrTradeExpirationDeniedErrTradeTooManyOrderspublic int ordersHistoryTotal()
public double orderStopLoss()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic int ordersTotal()
public double orderSwap()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic String orderSymbol() throws ErrNoOrderSelected
ErrNoOrderSelectedpublic double orderTakeProfit()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic int orderTicket()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic int orderType()
throws ErrNoOrderSelected
ErrNoOrderSelectedpublic boolean isTradeContextBusy()
public boolean refreshRates()
public int accountStopoutLevel()
public int accountStopoutMode()
public int messageBox(String text, String caption, int flags)
text - Text that contains the message to be displayed.caption - Text to be displayed in the header of the dialog box. If this parameter is NULL, the expert name will be displayed in the header.flags - Flags that determine the type and behavior of the dialog box (see enumeration class MessageBoxFlag). They can represent a conbination of flags from the following groups.public int uninitializeReason()
public boolean isTradeAllowed()
public boolean isStopped()
public boolean isOptimization()
public boolean isLibrariesAllowed()
public boolean isDllsAllowed()
public boolean isExpertEnabled()
public double accountFreeMarginCheck(String symbol, TradeOperation cmd, double volume)
symbol - Symbol for trading operation.cmd - Operation type. It can be either OP_BUY or OP_SELL.volume - Number of lots.public double accountFreeMarginMode()
public int accountLeverage()
public String accountServer()
public String terminalCompany()
public String terminalName()
public String terminalPath()
public void alert(String arg)
arg - Any value.public void playSound(String filename)
filename - Path to the sound file.public String objectDescription(String name)
name - Object name.public int objectFind(String name)
name - Object name to search for.public int objectGetShiftByValue(String name, double value)
name - Object name.value - Price value.public double objectGetValueByShift(String name, int shift)
name - Object name.shift - Bar index.public boolean objectMove(String name, int point, Date time1, double price1)
name - Object name.point - Coordinate index (0-2).time1 - New time value.price1 - New price value.public String objectName(int index)
index - Object index in the objects list. Object index must exceed or equal to 0 and be less than ObjectsTotal().public int objectsDeleteAll(int window,
int type)
window - Index of the window in which the objects will be deleted. Must exceed or equal to -1 (EMPTY, the default value) and be less than WindowsTotal().type - An object type to be deleted. It can be any of the Object type enumeration values or EMPTY constant to delete all objects with any types.public double iIchimoku(String symbol, Timeframe timeframe, int tenkan_sen, int kijun_sen, int senkou_span_b, IchimokuSource mode, int shift) throws ErrUnknownSymbol
symbol - Symbol name of the security on the data of which the indicator will be calculated. NULL means the current symbol.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.tenkan_sen - Tenkan Sen averaging period.kijun_sen - Kijun Sen averaging period.senkou_span_b - Senkou SpanB averaging period.mode - Source of data. It can be one of the Ichimoku Kinko Hyo mode enumeration.shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).ErrUnknownSymbolpublic void hideTestIndicators(boolean shift)
shift - TRUE, if there is a need to hide indicators, or else FALSE.public int period()
public String symbol()
public int windowBarsPerChart()
public int windowFirstVisibleBar()
public String windowExpertName()
public int windowFind(String name)
name - Indicator short name.public boolean windowIsVisible(int index)
index - Chart subwindow index.public double windowPriceMax(int index)
index - Chart subwindow index (0 - main chart window).public double windowPriceMin(int index)
index - Chart subwindow index (0 - main chart window).public int windowOnDropped()
public int windowXOnDropped()
public int windowYOnDropped()
public double windowPriceOnDropped()
public Date windowTimeOnDropped()
public int windowsTotal()
public void windowRedraw()
public boolean windowScreenShot(String filename, int sizeX, int sizeY, int startBar, int chartScale, int chartMode)
filename - Screen shot file name.sizeX - Screen shot width in pixels.sizeY - Screen shot height in pixels.startBar - Index of the first visible bar in the screen shot. If 0 value is set, the current first visible bar will be shot. If no value or negative value has been set, the end-of-chart screen shot will be produced, indent being taken into consideration.chartScale - Horizontal chart scale for screen shot. Can be in the range from 0 to 5. If no value or negative value has been set, the current chart scale will be used.chartMode - Chart displaying mode. It can take the following values: CHART_BAR (0 is a sequence of bars), CHART_CANDLE (1 is a sequence of candlesticks), CHART_LINE (2 is a close prices line). If no value or negative value has been set, the chart will be shown in its current mode.public int windowHandle(String symbol, Timeframe timeframe)
symbol - symbol name.timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.public boolean globalVariableCheck(String name)
name - Global variable name.public boolean globalVariableDel(String name)
name - Global variable name.public double globalVariableGet(String name)
name - Global variable name.public String globalVariableName(int index)
index - Index in the list of global variables. It must exceed or be equal to 0 and be less than GlobalVariablesTotal().public Date globalVariableSet(String name, double value)
name - Global variable name.value - The new numeric value.public boolean globalVariableSetOnCondition(String name, double value, double check_value) throws ErrGlobalVariableNotFound
name - Global variable name.value - The new numeric value.check_value - Value to be compared to the current global variable value.ErrGlobalVariableNotFoundpublic int globalVariablesDeleteAll(String prefix)
prefix - Name prefix of the global variables to be deleted.public int globalVariablesTotal()