getChartHandle (SDK Trading)

getChartHandle is a Fintechee API to open a chart and get the handle(a kind of selector) of the opened chart.

The supported time frames include "M1", "M5", "M15", "M30", "H1", "H4", "D".

The handle would be used to get the data in the onTick callback function. So you need to transfer it to the onTick function by setting it as a property of window object.

getChartHandle(context, brokerName, accountId, symbolName, timeFrame) ⇒ number

EA SDK This function gets the handle of the specific chart. Phase (this API's scope): init

Kind: global function
Returns: number - handle.

Param Type Description
context object the name should be the same with the name of parameter of onTickFunction
brokerName string broker name
accountId string account ID
symbolName string symbol name
timeFrame string time frame

getChartHandle (SDK Trading)

registerEA(
"test_api",
"An EA to test APIs",
[],
function (context) { // Init()
    var account = getAccount(context, 0)
	var brokerName = getBrokerNameOfAccount(account)
	var accountId = getAccountIdOfAccount(account)
	var symbolName = "EUR/USD"

    window.chartHandle = getChartHandle(context, brokerName, accountId, symbolName, TIME_FRAME.M1)
},
function (context) { // Deinit()
},
function (context) { // OnTick()
})