Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

• ## Welcome Guests

Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

# Easy Language Error

## Recommended Posts

hi,

i ve this script:

[LegacyColorValue = TRUE];

Poly Inner Channel.

This indicator plots a regression line and two standard deviation bands around it.

====================================== DECLARATIONS ==================================}

inputs:

Len (150),

RedLineLen(150),

Order (3),

SDev(.5),{why not make these inputs}

Price ©; {this cannot be a var, for some reason}

vars:

CURSOR (FALSE),

LASTBAR (TRUE),

sigma (0),

f (0),

Y(0),

b0 (0),

b1 (0),

b2 (0),

b3 (0),

b4 (0);

VARS:

JLAOK(TRUE),

JLAPASS1(0),

JLAPASS2(0),

JLAPASS3(0),

JLAPASS4(0),

JLAPASS5(0),

JLAPASS6(0);

{=========================================MAIN PROGRAM ===================================}

VALUE98=POLY_COEFFS(price,len,order,CURSOR,LASTBAR,b0,b1,b2,b3,b4);

value97=LinearRegValue( Price, RedLineLen, 0 );

if (lastbaronchart and lastbar) or (atcommentarybar and cursor) then

begin

sigma= stddev(price,len);

y=(len-1);

f=0;

while y>(-2)

begin

value5=( b0

+(b1 *f )

+(b2*(power(f, 2)))

+(b3*(power(f, 3)))

+(b4*(power(f, 4)))

);

plot1[y] (value5,"regression");

plot2[y] (value5 + (sdev * sigma ),"Channel+1");

plot3[y] (value5 - (sdev * sigma ),"LChannel -1");

plot4[y] (value97[y], "LR Momentum" );

y=y-1;

f=f+1;

end;

end;

{

commentarycl("b0 = ", b0);

commentarycl("b1 = ", b1);

commentarycl("b2 = ", b2);

commentarycl("b3 = ", b3);

commentarycl("b4 = ", b4);

}

.... but plotting it in multicharts i recive this popup:

Messagge:Error in study "SIGMA INNER CHANNEL

trying to access future data. Bar reference value:-1.

CAN PLEASE ANYBODY HELP ME TO CORRECT THE SCRIPT?

thank you very much

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• 0
• 0
• -1
• 0
• 2
• ### Posts

• CFDs are quite attractive to day traders who would be able to utilize leverage for trading assets that would be more costly to buy as well as sell. CFDs could be quite risky due to low industry regulation, potential lack of liquidity, as well as the requirement of maintaining an adequate margin due to leveraged losses.
• Demo Trading is considered to be a learning platform for obtaining knowledge about the Market Structure in Forex. But most traders make the mistake of jumping into the market thinking that they have learned a lot by just doing a Demo, which leads them to failure.