getOpenTrade (SDK Trading)
getOpenTrade is a Fintechee API to get the specific open trade from the open trades list. You can specify the open trade that you want to get by the selector(the index of the open trade).
object
getOpenTrade(context, selector) ⇒ EA SDK This function gets open trade. Phase (this API's scope): onTick | deinit
Kind: global function
Returns: object
- open trade.
Param | Type | Description |
---|---|---|
context | object | the name should be the same with the name of parameter of onTickFunction |
selector | number | index of open trade |
getOpenTrade (SDK Trading)
registerEA(
"test_api",
"An EA to test APIs",
[],
function (context) { // Init()
},
function (context) { // Deinit()
},
function (context) { // OnTick()
var length = getOpenTradesListLength(context)
for (var i = 0; i < length; i++) {
var openTrade = getOpenTrade(context, i)
}
})