Easy Language: Indicator call series function failed.

Questions about MultiCharts and user contributed studies.
ragdoll
Posts: 49
Joined: 04 Apr 2019
Has thanked: 4 times

Easy Language: Indicator call series function failed.

Postby ragdoll » 12 Jun 2020

I have a indicator in which I call a trial function which is a series function. There is nothing to display. However, if I comment out the call of lowest function, then there is something do display. Another issue is i_MarketPosition[1] does not work. Is there anybody could help on these please? Thanks.

Indicator of trial_ind:

Code: Select all

variables: prev_MarketPosition(0), startbar(0); if i_MarketPosition = 0 then startbar = 0; if i_MarketPosition <> 0 and prev_MarketPosition = 0 then startbar = (currentbar + MaxBarsBack); prev_MarketPosition = i_MarketPosition; if i_MarketPosition <> 0 then begin plot1(trial(startbar), "trial"); end;
Function of trial:

Code: Select all

inputs: startbarnum(numericsimple); variables: startbar(0), prev_lowest(0); startbar = startbarnum - MaxBarsBack; trial = 1 + 2; lowest(low[1], currentbar - startbar); if trial < trial[1] then trial = trial[1]; if false then value0 = trial[1];

User avatar
TJ
Posts: 7743
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Easy Language: Indicator call series function failed.

Postby TJ » 12 Jun 2020

Why are you not assigning the lowest function to a variable?

ragdoll
Posts: 49
Joined: 04 Apr 2019
Has thanked: 4 times

Re: Easy Language: Indicator call series function failed.

Postby ragdoll » 12 Jun 2020

Thanks for reply. I also tried assign that lowest function to a variable but with same result.
Why are you not assigning the lowest function to a variable?

ragdoll
Posts: 49
Joined: 04 Apr 2019
Has thanked: 4 times

Re: Easy Language: Indicator call series function failed.

Postby ragdoll » 16 Jun 2020

I found if I comment out the if statement about i_MarketPostion and prev_MarketPosition, then the program will run. Otherwise, it will always be calculating. Any idea please?

Indicator:

Code: Select all

variables: prev_MarketPosition(0), startbar(0); if i_MarketPosition = 0 then startbar = 0; //if i_MarketPosition <> 0 and prev_MarketPosition = 0 then startbar = (currentbar + MaxBarsBack); startbar = (currentbar + MaxBarsBack); prev_MarketPosition = i_MarketPosition; if i_MarketPosition <> 0 then begin plot1(trial(startbar), "trial"); end;
Function:

Code: Select all

inputs: startbarnum(numericsimple); variables: startbar(0), prev_lowest(0); startbar = startbarnum - MaxBarsBack; trial = 1 + 2; value0 = lowest(low[1], currentbar - startbar); if trial < trial[1] then trial = trial[1]; if false then value0 = trial[1];


Return to “MultiCharts”