Skip to content

how to pass in custom input values? #38

@gbarton

Description

@gbarton

Greetings,
Great project you have here! I have been messing around with it and I am curious how one can pass in custom input values for when the indicator is run? Say something simple like:

/*==[ Equivalent PineTS ]==*/

//
//'My EMA Cross Strategy';

const emaLength = input.int(9, "Default ema length");

let ema9 = ta.ema(close, emaLength);
let ema18 = ta.ema(close, 18);

let bull_bias = ema9 > ema18;
let bear_bias = ema9 < ema18;

let prev_close = close[1];
let diff_close = close - prev_close;

let _oo = open;
_oo = math.abs(open[1] - close[2]);

How do I set this up so I can pass in 12 for emaLength?
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions