* Get pine inputs * @param {PineIndicator | BuiltInIndicator} options
(options)
| 10 | * @param {PineIndicator | BuiltInIndicator} options |
| 11 | */ |
| 12 | function getInputs(options) { |
| 13 | if (options instanceof PineIndicator) { |
| 14 | const pineInputs = { text: options.script }; |
| 15 | |
| 16 | if (options.pineId) pineInputs.pineId = options.pineId; |
| 17 | if (options.pineVersion) pineInputs.pineVersion = options.pineVersion; |
| 18 | |
| 19 | Object.keys(options.inputs).forEach((inputID, n) => { |
| 20 | const input = options.inputs[inputID]; |
| 21 | |
| 22 | pineInputs[inputID] = { |
| 23 | v: (input.type !== 'color') ? input.value : n, |
| 24 | f: input.isFake, |
| 25 | t: input.type, |
| 26 | }; |
| 27 | }); |
| 28 | |
| 29 | return pineInputs; |
| 30 | } |
| 31 | |
| 32 | return options.options; |
| 33 | } |
| 34 | |
| 35 | const parseTrades = (trades) => trades.reverse().map((t) => ({ |
| 36 | entry: { |
no outgoing calls
no test coverage detected