Another Simple System

Questions about MultiCharts and user contributed studies.
Micardo
Posts: 7
Joined: 26 Feb 2011

Another Simple System

Postby Micardo » 02 Mar 2011

Hi Everyone,

I am trying to develop a system where you take a buy above the PivotHighVSBar.

However everytime I try to add it to the chart I get an error - "Trying access at data to future. Bars reference value: -1."

The code I am using is

Code: Select all

inputs: Price( High ), LeftStrength( 3 ), RightStrength( 3 ) ;

value1 = PivotHighVSBar( 1, Price, LeftStrength, RightStrength, RightStrength + 1 );
value2 = High[value1];

condition1 = PivotHighVSBar( 1, Price, LeftStrength, RightStrength, RightStrength + 1 ) <> -1 ;

if condition1 then
if XAverage(Close, 30) > XAverage(Close, 50) AND XAverage(Close, 50) > XAverage(Close, 100) then
if Close > value2 then buy next bar at market;
Does anyone have any ideas tips or pointers?

Thanks

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

Re: Another Simple System

Postby TJ » 02 Mar 2011

Hi Everyone,

I am trying to develop a system where you take a buy above the PivotHighVSBar.

However everytime I try to add it to the chart I get an error - "Trying access at data to future. Bars reference value: -1."

The code I am using is

Code: Select all

inputs: Price( High ), LeftStrength( 3 ), RightStrength( 3 ) ;

value1 = PivotHighVSBar( 1, Price, LeftStrength, RightStrength, RightStrength + 1 );
value2 = High[value1];

condition1 = PivotHighVSBar( 1, Price, LeftStrength, RightStrength, RightStrength + 1 ) <> -1 ;

if condition1 then
if XAverage(Close, 30) > XAverage(Close, 50) AND XAverage(Close, 50) > XAverage(Close, 100) then
if Close > value2 then buy next bar at market;
Does anyone have any ideas tips or pointers?

Thanks
have you tried the suggestion I gave you in post #2?
viewtopic.php?f=1&t=8283


Return to “MultiCharts”