getEAParameter (SDK Trading)

getEAParameter is a Fintechee API to get the value of the specific parameter of the expert advisor(trading robot).

The type of a parameter can be Integer, Number, Boolean, String. The String type has no range, so please set the String type's range always by null.

getEAParameter(context, paramName) ⇒ number | string

EA SDK This function gets parameter's value of EA. Phase (this API's scope): init | onTick | deinit

Kind: global function
Returns: number | string - the value of parameter.

Param Type Description
context object the name should be the same with the name of parameter of onTickFunction
paramName string the name of parameter

getEAParameter (SDK Trading)

registerEA(
"test_api",
"An EA to test APIs",
[{
    name: "period",
    value: 10,
    required: true,
    type: "Integer",
    ranger: [1, 100]
}],
function (context) { // Init()
    var period = getEAParameter(context, "period")
},
function (context) { // Deinit()
},
function (context) { // OnTick()
    var period = getEAParameter(context, "period")
})