Minlist constantly returning 0  [SOLVED]

Questions about MultiCharts and user contributed studies.
ravel44
Posts: 28
Joined: 05 Jul 2012
Has thanked: 7 times

Minlist constantly returning 0

Postby ravel44 » 16 Jun 2016

Hi !
I've been programming a trailing value with the following code for long positions, it is working properly:

Code: Select all

vars:
trailing(0);

if marketposition=1 then Trailing= maxlist(trailing,H-2);
However when trying to do the same for short, minlist is constantly returning 0 instead of returning the lowest value of L+2 and I don't manage to understand why and couldn't find a solution so far.

Code: Select all

vars:
trailing(0);
if marketposition=-1 then trailing=minlist(trailing,L+2);
Thanks for the help

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

Re: Minlist constantly returning 0  [SOLVED]

Postby TJ » 16 Jun 2016

Hi !
I've been programming a trailing value with the following code for long positions, it is working properly:

Code: Select all

vars:
trailing(0);

if marketposition=1 then Trailing= maxlist(trailing,H-2);
However when trying to do the same for short, minlist is constantly returning 0 instead of returning the lowest value of L+2 and I don't manage to understand why and couldn't find a solution so far.

Code: Select all

vars:
trailing(0);
if marketposition=-1 then trailing=minlist(trailing,L+2);
Thanks for the help
Because of your declaration:
vars:
trailing( 0 );

ravel44
Posts: 28
Joined: 05 Jul 2012
Has thanked: 7 times

Re: Minlist constantly returning 0

Postby ravel44 » 16 Jun 2016

Hi !
I've been programming a trailing value with the following code for long positions, it is working properly:

Code: Select all

vars:
trailing(0);

if marketposition=1 then Trailing= maxlist(trailing,H-2);
However when trying to do the same for short, minlist is constantly returning 0 instead of returning the lowest value of L+2 and I don't manage to understand why and couldn't find a solution so far.

Code: Select all

vars:
trailing(0);
if marketposition=-1 then trailing=minlist(trailing,L+2);
Thanks for the help
Because of your declaration:
vars:
trailing( 0 );
Thank U ! I replaced 0 by C and it s working now.
Attachments
Screen Shot 2016-06-16 at 1.40.49 PM.png
(30.92 KiB) Downloaded 783 times


Return to “MultiCharts”