Very slow rendering indicator  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
TomasD
Posts: 10
Joined: 04 Mar 2015
Location: Czech Republic, Central Europe
Has thanked: 3 times
Been thanked: 2 times

Very slow rendering indicator

Postby TomasD » 14 Dec 2015

I have a major 30min timeframe when I switch on 1 minute timeframe, the indicator takes a long time to appear. I tried to use the data(2), but it did not help.

Please advise anyone

Code: Select all

Inputs:
IBW72.8(72.8), // %72,8
IBW27.2(27.2), // %27,2
IBW127.2(127.2), // %127,2
IBW161.8(161.8), // %161,8
IBW200(200), // %200
IBW227.2(227.2), // %227,2
IBW261.8(261.8), // %261,8
IBW300(300); // %300

variable:
IBWhigh(0), // high za pondeli a utery
IBWlow(0), // low za pondeli a utery
IBWrange(0),

IBW_72.8(0),
IBW_27.2(0),
IBW_127.2(0),
IBW_161.8(0),
IBW_200(0),
IBW_227.2(0),
IBW_261.8(0),
IBW_300(0),
IBW__127.2(0), // %-127,2
IBW__161.8(0), // %-161,8
IBW__200(0), // %-200
IBW__227.2(0), // %-227,2
IBW__261.8(0), // %-261,8
IBW__300(0), // %-300

IBWhighLine(0),
IBWlowLine(0),

IBW_72.8Line(0),
IBW_27.2Line(0),
IBW_127.2Line(0),
IBW_161.8Line(0),
IBW_200Line(0),
IBW_227.2Line(0),
IBW_261.8Line(0),
IBW_300Line(0),
IBW__127.2Line(0),
IBW__161.8Line(0),
IBW__200Line(0),
IBW__227.2Line(0),
IBW__261.8Line(0),
IBW__300Line(0),


IBWhighText(0),
IBWlowText(0),

IBW_72.8Text(0),
IBW_27.2Text(0),
IBW_127.2Text(0),
IBW_161.8Text(0),
IBW_200Text(0),
IBW_227.2Text(0),
IBW_261.8Text(0),
IBW_300Text(0),
IBW__127.2Text(0),
IBW__161.8Text(0),
IBW__200Text(0),
IBW__227.2Text(0),
IBW__261.8Text(0),
IBW__300Text(0),


y(0);



// podminky zaokrouhlovani na ruznych forex parech
if
symbol="EUR.USD" or
symbol="GBP.USD" or
symbol="USD.CHF" or
symbol="EUR.AUD" or
symbol="GBP.AUD" or
symbol="AUD.CAD" or
symbol="EUR.CAD" or
symbol="GBP.CAD" or
symbol="NZD.CAD" or
symbol="USD.CAD" or
symbol="AUD.CHF" or
symbol="CAD.CHF" or
symbol="EUR.CHF" or
symbol="GBP.CHF" or
symbol="NZD.CHF" or
symbol="EUR.GBP" or
symbol="AUD.NZD" or
symbol="EUR.NZD" or
symbol="GBP.NZD" or
symbol="AUD.USD" or
symbol="NZD.USD" or
symbol="AUD.SGD" or
symbol="EUR.SGD" or
symbol="USD.SGD" then begin

y=4;
end
else begin
y=2;
end;


// definice ze je streda a je treba urit high/low za pondeli a utery, tim zaroven range
if
dayofweek(date)=3 then
begin
IBWhigh=Round(maxlist(HighD(1),HighD(2)),y);
IBWlow=Round(minlist(LowD(1),LowD(2)),y);
IBWrange=IBWhigh-IBWlow;
end;

// vapocet jednotlivych urovni
IBW_72.8=Round(IBWlow+(IBWrange*IBW72.8)/100,y); // %72,8
IBW_27.2=Round(IBWlow+(IBWrange*IBW27.2)/100,y); // %27,2
IBW_127.2=Round(IBWlow+(IBWrange*IBW127.2)/100,y); // %127,2
IBW_161.8=Round(IBWlow+(IBWrange*IBW161.8)/100,y); // %161,8
IBW_200=Round(IBWlow+(IBWrange*IBW200)/100,y); // %200
IBW_227.2=Round(IBWlow+(IBWrange*IBW227.2)/100,y); // %227,2
IBW_261.8=Round(IBWlow+(IBWrange*IBW261.8)/100,y); // %261,8
IBW_300=Round(IBWlow+(IBWrange*IBW300)/100,y); // %300

IBW__127.2=Round(IBWhigh-(IBWrange*IBW127.2)/100,y); // %-127,2
IBW__161.8=Round(IBWhigh-(IBWrange*IBW161.8)/100,y); // %-161,8
IBW__200=Round(IBWhigh-(IBWrange*IBW200)/100,y); // %-200
IBW__227.2=Round(IBWhigh-(IBWrange*IBW227.2)/100,y); // %-227,2
IBW__261.8=Round(IBWhigh-(IBWrange*IBW261.8)/100,y); // %-261,8
IBW__300=Round(IBWhigh-(IBWrange*IBW300)/100,y); // %-300


/// nejvyssi high za pondeli a utery
IBWhighLine=tl_new(d[1],t[1],IBWhigh,d,t+30,IBWhigh);
tl_setcolor(IBWhighLine,green);

IBWhighText=text_new(d,t+30,IBWhigh,"IBW High ("+numtostr(IBWhigh,y)+")");
Text_SetStyle(IBWhighText, 0, 1 ) ;
Text_SetColor(IBWhighText,green);

/// nejnizsi low za pondeli a utery
IBWlowLine=tl_new(d[1],t[1],IBWlow,d,t+30,IBWlow);
tl_setcolor(IBWlowLine,red);

IBWlowText=text_new(d,t+30,IBWlow,"IBW Low ("+numtostr(IBWlow,y)+")");
Text_SetStyle(IBWlowText, 0, 1 ) ;
Text_SetColor(IBWlowText,red);

/// uroven %72.8
IBW_72.8Line=tl_new(d[1],t[1],IBW_72.8,d,t+30,IBW_72.8);
tl_setcolor(IBW_72.8Line,RGB(255,255,0));
TL_setstyle(IBW_72.8Line,3);

IBW_72.8Text=text_new(d,t+30,IBW_72.8,"IBW %72.8 ("+numtostr(IBW_72.8,y)+")");
Text_SetStyle(IBW_72.8Text, 0, 1 ) ;
Text_SetColor(IBW_72.8Text,RGB(255,255,0));

/// uroven %27.2
IBW_27.2Line=tl_new(d[1],t[1],IBW_27.2,d,t+30,IBW_27.2);
tl_setcolor(IBW_27.2Line,RGB(131,111,255));
TL_setstyle(IBW_27.2Line,3);

IBW_27.2Text=text_new(d,t+30,IBW_27.2,"IBW %72.8 ("+numtostr(IBW_27.2,y)+")");
Text_SetStyle(IBW_27.2Text, 0, 1 ) ;
Text_SetColor(IBW_27.2Text,RGB(131,111,255));

/// uroven %127.2
IBW_127.2Line=tl_new(d[1],t[1],IBW_127.2,d,t+30,IBW_127.2);
tl_setcolor(IBW_127.2Line,RGB(192,255,255));
TL_setstyle(IBW_127.2Line,3);

IBW_127.2Text=text_new(d,t+30,IBW_127.2,"IBW %127.2 ("+numtostr(IBW_127.2,y)+")");
Text_SetStyle(IBW_127.2Text, 0, 1 ) ;
Text_SetColor(IBW_127.2Text,RGB(192,255,255));

/// uroven %161.8
IBW_161.8Line=tl_new(d[1],t[1],IBW_161.8,d,t+30,IBW_161.8);
tl_setcolor(IBW_161.8Line,RGB(192,255,255));
TL_setstyle(IBW_161.8Line,3);

IBW_161.8Text=text_new(d,t+30,IBW_161.8,"IBW %161.8 ("+numtostr(IBW_161.8,y)+")");
Text_SetStyle(IBW_161.8Text, 0, 1 ) ;
Text_SetColor(IBW_161.8Text,RGB(192,255,255));

/// uroven %200
IBW_200Line=tl_new(d[1],t[1],IBW_200,d,t+30,IBW_200);
tl_setcolor(IBW_200Line,RGB(255,192,203));
TL_setstyle(IBW_200Line,3);

IBW_200Text=text_new(d,t+30,IBW_200,"IBW %200 ("+numtostr(IBW_200,y)+")");
Text_SetStyle(IBW_200Text, 0, 1 ) ;
Text_SetColor(IBW_200Text,RGB(255,192,203));

/// uroven %227.2
IBW_227.2Line=tl_new(d[1],t[1],IBW_227.2,d,t+30,IBW_227.2);
tl_setcolor(IBW_227.2Line,RGB(192,255,255));
TL_setstyle(IBW_227.2Line,3);

IBW_227.2Text=text_new(d,t+30,IBW_227.2,"IBW %227.2 ("+numtostr(IBW_227.2,y)+")");
Text_SetStyle(IBW_227.2Text, 0, 1 ) ;
Text_SetColor(IBW_227.2Text,RGB(192,255,255));

/// uroven %261.8
IBW_261.8Line=tl_new(d[1],t[1],IBW_261.8,d,t+30,IBW_261.8);
tl_setcolor(IBW_261.8Line,RGB(192,255,255));
TL_setstyle(IBW_261.8Line,3);

IBW_261.8Text=text_new(d,t+30,IBW_261.8,"IBW %261.8 ("+numtostr(IBW_261.8,y)+")");
Text_SetStyle(IBW_261.8Text, 0, 1 ) ;
Text_SetColor(IBW_261.8Text,RGB(192,255,255));

/// uroven %300
IBW_300Line=tl_new(d[1],t[1],IBW_300,d,t+30,IBW_300);
tl_setcolor(IBW_300Line,RGB(165,42,0));
TL_setstyle(IBW_300Line,3);

IBW_300Text=text_new(d,t+30,IBW_300,"IBW %300 ("+numtostr(IBW_300,y)+")");
Text_SetStyle(IBW_300Text, 0, 1 ) ;
Text_SetColor(IBW_300Text,RGB(165,42,0));




/// uroven %-127.2
IBW__127.2Line=tl_new(d[1],t[1],IBW__127.2,d,t+30,IBW__127.2);
tl_setcolor(IBW__127.2Line,RGB(192,255,255));
TL_setstyle(IBW__127.2Line,3);

IBW__127.2Text=text_new(d,t+30,IBW__127.2,"IBW %-127.2 ("+numtostr(IBW__127.2,y)+")");
Text_SetStyle(IBW__127.2Text, 0, 1 ) ;
Text_SetColor(IBW__127.2Text,RGB(192,255,255));

/// uroven %-161.8
IBW__161.8Line=tl_new(d[1],t[1],IBW__161.8,d,t+30,IBW__161.8);
tl_setcolor(IBW__161.8Line,RGB(192,255,255));
TL_setstyle(IBW__161.8Line,3);

IBW__161.8Text=text_new(d,t+30,IBW__161.8,"IBW %-161.8 ("+numtostr(IBW__161.8,y)+")");
Text_SetStyle(IBW__161.8Text, 0, 1 ) ;
Text_SetColor(IBW__161.8Text,RGB(192,255,255));

/// uroven %-200
IBW__200Line=tl_new(d[1],t[1],IBW__200,d,t+30,IBW__200);
tl_setcolor(IBW__200Line,RGB(255,192,203));
TL_setstyle(IBW__200Line,3);

IBW__200Text=text_new(d,t+30,IBW__200,"IBW %-200 ("+numtostr(IBW__200,y)+")");
Text_SetStyle(IBW__200Text, 0, 1 ) ;
Text_SetColor(IBW__200Text,RGB(255,192,203));

/// uroven %-227.2
IBW__227.2Line=tl_new(d[1],t[1],IBW__227.2,d,t+30,IBW__227.2);
tl_setcolor(IBW__227.2Line,RGB(192,255,255));
TL_setstyle(IBW__227.2Line,3);

IBW__227.2Text=text_new(d,t+30,IBW__227.2,"IBW %-227.2 ("+numtostr(IBW__227.2,y)+")");
Text_SetStyle(IBW__227.2Text, 0, 1 ) ;
Text_SetColor(IBW__227.2Text,RGB(192,255,255));

/// uroven %-261.8
IBW__261.8Line=tl_new(d[1],t[1],IBW__261.8,d,t+30,IBW__261.8);
tl_setcolor(IBW__261.8Line,RGB(192,255,255));
TL_setstyle(IBW__261.8Line,3);

IBW__261.8Text=text_new(d,t+30,IBW__261.8,"IBW %-261.8 ("+numtostr(IBW__261.8,y)+")");
Text_SetStyle(IBW__261.8Text, 0, 1 ) ;
Text_SetColor(IBW__261.8Text,RGB(192,255,255));

/// uroven %-300
IBW__300Line=tl_new(d[1],t[1],IBW__300,d,t+30,IBW__300);
tl_setcolor(IBW__300Line,RGB(165,42,0));
TL_setstyle(IBW__300Line,3);

IBW__300Text=text_new(d,t+30,IBW__300,"IBW %-300 ("+numtostr(IBW__300,y)+")");
Text_SetStyle(IBW__300Text, 0, 1 ) ;
Text_SetColor(IBW__300Text,RGB(165,42,0));



// smazani starych popisek urovni
if
IBWhighText<>IBWhighText[1] then
begin

text_delete(IBWhighText[1]);
text_delete(IBWlowText[1]);
text_delete(IBW_72.8Text[1]);
text_delete(IBW_27.2Text[1]);
text_delete(IBW_127.2Text[1]);
text_delete(IBW_161.8Text[1]);
text_delete(IBW_200Text[1]);
text_delete(IBW_227.2Text[1]);
text_delete(IBW_261.8Text[1]);
text_delete(IBW_300Text[1]);

text_delete(IBW__127.2Text[1]);
text_delete(IBW__161.8Text[1]);
text_delete(IBW__200Text[1]);
text_delete(IBW__227.2Text[1]);
text_delete(IBW__261.8Text[1]);
text_delete(IBW__300Text[1]);
end;

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

Re: Very slow rendering indicator

Postby TJ » 14 Dec 2015

I have a major 30min timeframe when I switch on 1 minute timeframe, the indicator takes a long time to appear. I tried to use the data(2), but it did not help.

Please advise anyone

::
Look up these keywords. They might help.

ONCE
TL_SetExtRight




ps. Your drawing objects (ie TL) should always be inside a condition.

User avatar
TomasD
Posts: 10
Joined: 04 Mar 2015
Location: Czech Republic, Central Europe
Has thanked: 3 times
Been thanked: 2 times

Re: Very slow rendering indicator

Postby TomasD » 14 Dec 2015

I have a major 30min timeframe when I switch on 1 minute timeframe, the indicator takes a long time to appear. I tried to use the data(2), but it did not help.

Please advise anyone

::
Look up these keywords. They might help.

ONCE
TL_SetExtRight




ps. Your drawing objects (ie TL) should always be inside a condition.
Thanks, I managed to accelerate. I put drawing objects (ie TL and Text) into conditions and used TL_SetExtRight.

I did not come on ways to use ONCE and if necessary

Code: Select all

Inputs:
IBW72.8(72.8), // %72,8
IBW27.2(27.2), // %27,2
IBW127.2(127.2), // %127,2
IBW161.8(161.8), // %161,8
IBW200(200), // %200
IBW227.2(227.2), // %227,2
IBW261.8(261.8), // %261,8
IBW300(300); // %300

variable:
IBWhigh(0), // high za pondeli a utery
IBWlow(0), // low za pondeli a utery
IBWrange(0),

IBW_72.8(0),
IBW_27.2(0),
IBW_127.2(0),
IBW_161.8(0),
IBW_200(0),
IBW_227.2(0),
IBW_261.8(0),
IBW_300(0),
IBW__127.2(0), // %-127,2
IBW__161.8(0), // %-161,8
IBW__200(0), // %-200
IBW__227.2(0), // %-227,2
IBW__261.8(0), // %-261,8
IBW__300(0), // %-300

IBWhighLine(0),
IBWlowLine(0),

IBW_72.8Line(0),
IBW_27.2Line(0),
IBW_127.2Line(0),
IBW_161.8Line(0),
IBW_200Line(0),
IBW_227.2Line(0),
IBW_261.8Line(0),
IBW_300Line(0),
IBW__127.2Line(0),
IBW__161.8Line(0),
IBW__200Line(0),
IBW__227.2Line(0),
IBW__261.8Line(0),
IBW__300Line(0),


IBWhighText(0),
IBWlowText(0),

IBW_72.8Text(0),
IBW_27.2Text(0),
IBW_127.2Text(0),
IBW_161.8Text(0),
IBW_200Text(0),
IBW_227.2Text(0),
IBW_261.8Text(0),
IBW_300Text(0),
IBW__127.2Text(0),
IBW__161.8Text(0),
IBW__200Text(0),
IBW__227.2Text(0),
IBW__261.8Text(0),
IBW__300Text(0),


y(0);



// podminky zaokrouhlovani na ruznych forex parech
if
symbol="EUR.USD" or
symbol="GBP.USD" or
symbol="USD.CHF" or
symbol="EUR.AUD" or
symbol="GBP.AUD" or
symbol="AUD.CAD" or
symbol="EUR.CAD" or
symbol="GBP.CAD" or
symbol="NZD.CAD" or
symbol="USD.CAD" or
symbol="AUD.CHF" or
symbol="CAD.CHF" or
symbol="EUR.CHF" or
symbol="GBP.CHF" or
symbol="NZD.CHF" or
symbol="EUR.GBP" or
symbol="AUD.NZD" or
symbol="EUR.NZD" or
symbol="GBP.NZD" or
symbol="AUD.USD" or
symbol="NZD.USD" or
symbol="AUD.SGD" or
symbol="EUR.SGD" or
symbol="USD.SGD" then begin

y=4;
end
else begin
y=2;
end;


if
dayofweek(date)=3 then
begin
IBWhigh=Round(maxlist(HighD(1),HighD(2)),y);
IBWlow=Round(minlist(LowD(1),LowD(2)),y);
IBWrange=IBWhigh-IBWlow;


// vapocet jednotlivych urovni
IBW_72.8=Round(IBWlow+(IBWrange*IBW72.8)/100,y); // %72,8
IBW_27.2=Round(IBWlow+(IBWrange*IBW27.2)/100,y); // %27,2
IBW_127.2=Round(IBWlow+(IBWrange*IBW127.2)/100,y); // %127,2
IBW_161.8=Round(IBWlow+(IBWrange*IBW161.8)/100,y); // %161,8
IBW_200=Round(IBWlow+(IBWrange*IBW200)/100,y); // %200
IBW_227.2=Round(IBWlow+(IBWrange*IBW227.2)/100,y); // %227,2
IBW_261.8=Round(IBWlow+(IBWrange*IBW261.8)/100,y); // %261,8
IBW_300=Round(IBWlow+(IBWrange*IBW300)/100,y); // %300

IBW__127.2=Round(IBWhigh-(IBWrange*IBW127.2)/100,y); // %-127,2
IBW__161.8=Round(IBWhigh-(IBWrange*IBW161.8)/100,y); // %-161,8
IBW__200=Round(IBWhigh-(IBWrange*IBW200)/100,y); // %-200
IBW__227.2=Round(IBWhigh-(IBWrange*IBW227.2)/100,y); // %-227,2
IBW__261.8=Round(IBWhigh-(IBWrange*IBW261.8)/100,y); // %-261,8
IBW__300=Round(IBWhigh-(IBWrange*IBW300)/100,y); // %-300


/// nejvyssi high za pondeli a utery
IBWhighLine=tl_new(d[1],t[1],IBWhigh,d,t+30,IBWhigh);
tl_setcolor(IBWhighLine,green);

IBWhighText=text_new(d,t+30,IBWhigh,"IBW High ("+numtostr(IBWhigh,y)+")");
Text_SetStyle(IBWhighText, 0, 1 ) ;
Text_SetColor(IBWhighText,green);

/// nejnizsi low za pondeli a utery
IBWlowLine=tl_new(d[1],t[1],IBWlow,d,t+30,IBWlow);
tl_setcolor(IBWlowLine,red);

IBWlowText=text_new(d,t+30,IBWlow,"IBW Low ("+numtostr(IBWlow,y)+")");
Text_SetStyle(IBWlowText, 0, 1 ) ;
Text_SetColor(IBWlowText,red);

/// uroven %72.8
IBW_72.8Line=tl_new(d[1],t[1],IBW_72.8,d,t+30,IBW_72.8);
tl_setcolor(IBW_72.8Line,RGB(255,255,0));
TL_setstyle(IBW_72.8Line,3);

IBW_72.8Text=text_new(d,t+30,IBW_72.8,"IBW %72.8 ("+numtostr(IBW_72.8,y)+")");
Text_SetStyle(IBW_72.8Text, 0, 1 ) ;
Text_SetColor(IBW_72.8Text,RGB(255,255,0));

/// uroven %27.2
IBW_27.2Line=tl_new(d[1],t[1],IBW_27.2,d,t+30,IBW_27.2);
tl_setcolor(IBW_27.2Line,RGB(131,111,255));
TL_setstyle(IBW_27.2Line,3);

IBW_27.2Text=text_new(d,t+30,IBW_27.2,"IBW %27.2 ("+numtostr(IBW_27.2,y)+")");
Text_SetStyle(IBW_27.2Text, 0, 1 ) ;
Text_SetColor(IBW_27.2Text,RGB(131,111,255));

/// uroven %127.2
IBW_127.2Line=tl_new(d[1],t[1],IBW_127.2,d,t+30,IBW_127.2);
tl_setcolor(IBW_127.2Line,RGB(192,255,255));
TL_setstyle(IBW_127.2Line,3);

IBW_127.2Text=text_new(d,t+30,IBW_127.2,"IBW %127.2 ("+numtostr(IBW_127.2,y)+")");
Text_SetStyle(IBW_127.2Text, 0, 1 ) ;
Text_SetColor(IBW_127.2Text,RGB(192,255,255));

/// uroven %161.8
IBW_161.8Line=tl_new(d[1],t[1],IBW_161.8,d,t+30,IBW_161.8);
tl_setcolor(IBW_161.8Line,RGB(192,255,255));
TL_setstyle(IBW_161.8Line,3);

IBW_161.8Text=text_new(d,t+30,IBW_161.8,"IBW %161.8 ("+numtostr(IBW_161.8,y)+")");
Text_SetStyle(IBW_161.8Text, 0, 1 ) ;
Text_SetColor(IBW_161.8Text,RGB(192,255,255));

/// uroven %200
IBW_200Line=tl_new(d[1],t[1],IBW_200,d,t+30,IBW_200);
tl_setcolor(IBW_200Line,RGB(255,192,203));
TL_setstyle(IBW_200Line,3);

IBW_200Text=text_new(d,t+30,IBW_200,"IBW %200 ("+numtostr(IBW_200,y)+")");
Text_SetStyle(IBW_200Text, 0, 1 ) ;
Text_SetColor(IBW_200Text,RGB(255,192,203));

/// uroven %227.2
IBW_227.2Line=tl_new(d[1],t[1],IBW_227.2,d,t+30,IBW_227.2);
tl_setcolor(IBW_227.2Line,RGB(192,255,255));
TL_setstyle(IBW_227.2Line,3);

IBW_227.2Text=text_new(d,t+30,IBW_227.2,"IBW %227.2 ("+numtostr(IBW_227.2,y)+")");
Text_SetStyle(IBW_227.2Text, 0, 1 ) ;
Text_SetColor(IBW_227.2Text,RGB(192,255,255));

/// uroven %261.8
IBW_261.8Line=tl_new(d[1],t[1],IBW_261.8,d,t+30,IBW_261.8);
tl_setcolor(IBW_261.8Line,RGB(192,255,255));
TL_setstyle(IBW_261.8Line,3);

IBW_261.8Text=text_new(d,t+30,IBW_261.8,"IBW %261.8 ("+numtostr(IBW_261.8,y)+")");
Text_SetStyle(IBW_261.8Text, 0, 1 ) ;
Text_SetColor(IBW_261.8Text,RGB(192,255,255));

/// uroven %300
IBW_300Line=tl_new(d[1],t[1],IBW_300,d,t+30,IBW_300);
tl_setcolor(IBW_300Line,RGB(165,42,0));
TL_setstyle(IBW_300Line,3);

IBW_300Text=text_new(d,t+30,IBW_300,"IBW %300 ("+numtostr(IBW_300,y)+")");
Text_SetStyle(IBW_300Text, 0, 1 ) ;
Text_SetColor(IBW_300Text,RGB(165,42,0));




/// uroven %-127.2
IBW__127.2Line=tl_new(d[1],t[1],IBW__127.2,d,t+30,IBW__127.2);
tl_setcolor(IBW__127.2Line,RGB(192,255,255));
TL_setstyle(IBW__127.2Line,3);

IBW__127.2Text=text_new(d,t+30,IBW__127.2,"IBW %-127.2 ("+numtostr(IBW__127.2,y)+")");
Text_SetStyle(IBW__127.2Text, 0, 1 ) ;
Text_SetColor(IBW__127.2Text,RGB(192,255,255));

/// uroven %-161.8
IBW__161.8Line=tl_new(d[1],t[1],IBW__161.8,d,t+30,IBW__161.8);
tl_setcolor(IBW__161.8Line,RGB(192,255,255));
TL_setstyle(IBW__161.8Line,3);

IBW__161.8Text=text_new(d,t+30,IBW__161.8,"IBW %-161.8 ("+numtostr(IBW__161.8,y)+")");
Text_SetStyle(IBW__161.8Text, 0, 1 ) ;
Text_SetColor(IBW__161.8Text,RGB(192,255,255));

/// uroven %-200
IBW__200Line=tl_new(d[1],t[1],IBW__200,d,t+30,IBW__200);
tl_setcolor(IBW__200Line,RGB(255,192,203));
TL_setstyle(IBW__200Line,3);

IBW__200Text=text_new(d,t+30,IBW__200,"IBW %-200 ("+numtostr(IBW__200,y)+")");
Text_SetStyle(IBW__200Text, 0, 1 ) ;
Text_SetColor(IBW__200Text,RGB(255,192,203));

/// uroven %-227.2
IBW__227.2Line=tl_new(d[1],t[1],IBW__227.2,d,t+30,IBW__227.2);
tl_setcolor(IBW__227.2Line,RGB(192,255,255));
TL_setstyle(IBW__227.2Line,3);

IBW__227.2Text=text_new(d,t+30,IBW__227.2,"IBW %-227.2 ("+numtostr(IBW__227.2,y)+")");
Text_SetStyle(IBW__227.2Text, 0, 1 ) ;
Text_SetColor(IBW__227.2Text,RGB(192,255,255));

/// uroven %-261.8
IBW__261.8Line=tl_new(d[1],t[1],IBW__261.8,d,t+30,IBW__261.8);
tl_setcolor(IBW__261.8Line,RGB(192,255,255));
TL_setstyle(IBW__261.8Line,3);

IBW__261.8Text=text_new(d,t+30,IBW__261.8,"IBW %-261.8 ("+numtostr(IBW__261.8,y)+")");
Text_SetStyle(IBW__261.8Text, 0, 1 ) ;
Text_SetColor(IBW__261.8Text,RGB(192,255,255));

/// uroven %-300
IBW__300Line=tl_new(d[1],t[1],IBW__300,d,t+30,IBW__300);
tl_setcolor(IBW__300Line,RGB(165,42,0));
TL_setstyle(IBW__300Line,3);

IBW__300Text=text_new(d,t+30,IBW__300,"IBW %-300 ("+numtostr(IBW__300,y)+")");
Text_SetStyle(IBW__300Text, 0, 1 ) ;
Text_SetColor(IBW__300Text,RGB(165,42,0));



// smazani starych popisek urovni
if
IBWhighText<>IBWhighText[1] then
begin

text_delete(IBWhighText[1]);
text_delete(IBWlowText[1]);
text_delete(IBW_72.8Text[1]);
text_delete(IBW_27.2Text[1]);
text_delete(IBW_127.2Text[1]);
text_delete(IBW_161.8Text[1]);
text_delete(IBW_200Text[1]);
text_delete(IBW_227.2Text[1]);
text_delete(IBW_261.8Text[1]);
text_delete(IBW_300Text[1]);

text_delete(IBW__127.2Text[1]);
text_delete(IBW__161.8Text[1]);
text_delete(IBW__200Text[1]);
text_delete(IBW__227.2Text[1]);
text_delete(IBW__261.8Text[1]);
text_delete(IBW__300Text[1]);
end;
end;

tl_setextright(IBWhighLine,false);
tl_setend(IBWhighline,d,t+30,IBWhigh);
text_setlocation(IBWhighText,d,t+30,IBWhigh);

tl_setextright(IBWlowLine,false);
tl_setend(IBWlowline,d,t+30,IBWlow);
text_setlocation(IBWlowText,d,t+30,IBWlow);

tl_setextright(IBW_72.8Line,false);
tl_setend(IBW_72.8Line,d,t+30,IBW_72.8);
text_setlocation(IBW_72.8Text,d,t+30,IBW_72.8);

tl_setextright(IBW_27.2Line,false);
tl_setend(IBW_27.2line,d,t+30,IBW_27.2);
text_setlocation(IBW_27.2Text,d,t+30,IBW_27.2);

tl_setextright(IBW_127.2Line,false);
tl_setend(IBW_127.2line,d,t+30,IBW_127.2);
text_setlocation(IBW_127.2Text,d,t+30,IBW_127.2);

tl_setextright(IBW_161.8Line,false);
tl_setend(IBW_161.8line,d,t+30,IBW_161.8);
text_setlocation(IBW_161.8Text,d,t+30,IBW_161.8);

tl_setextright(IBW_200Line,false);
tl_setend(IBW_200line,d,t+30,IBW_200);
text_setlocation(IBW_200Text,d,t+30,IBW_200);

tl_setextright(IBW_227.2Line,false);
tl_setend(IBW_227.2line,d,t+30,IBW_227.2);
text_setlocation(IBW_227.2Text,d,t+30,IBW_227.2);

tl_setextright(IBW_261.8Line,false);
tl_setend(IBW_261.8line,d,t+30,IBW_261.8);
text_setlocation(IBW_261.8Text,d,t+30,IBW_261.8);

tl_setextright(IBW_300Line,false);
tl_setend(IBW_300line,d,t+30,IBW_300);
text_setlocation(IBW_300Text,d,t+30,IBW_300);

tl_setextright(IBW__127.2Line,false);
tl_setend(IBW__127.2line,d,t+30,IBW__127.2);
text_setlocation(IBW__127.2Text,d,t+30,IBW__127.2);

tl_setextright(IBW__161.8Line,false);
tl_setend(IBW__161.8line,d,t+30,IBW__161.8);
text_setlocation(IBW__161.8Text,d,t+30,IBW__161.8);

tl_setextright(IBW__200Line,false);
tl_setend(IBW__200line,d,t+30,IBW__200);
text_setlocation(IBW__200Text,d,t+30,IBW__200);

tl_setextright(IBW__227.2Line,false);
tl_setend(IBW__227.2line,d,t+30,IBW__227.2);
text_setlocation(IBW__227.2Text,d,t+30,IBW__227.2);

tl_setextright(IBW__261.8Line,false);
tl_setend(IBW__261.8line,d,t+30,IBW__261.8);
text_setlocation(IBW__261.8Text,d,t+30,IBW__261.8);

tl_setextright(IBW__300Line,false);
tl_setend(IBW__300line,d,t+30,IBW__300);
text_setlocation(IBW__300Text,d,t+30,IBW__300);

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

Re: Very slow rendering indicator

Postby TJ » 14 Dec 2015

Thanks, I managed to accelerate. I put drawing objects (ie TL and Text) into conditions and used TL_SetExtRight.

I did not come on ways to use ONCE and if necessary
This code only needs to run once when you apply the indicator to the chart.

Code: Select all


if
symbol="EUR.USD" or

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

Re: Very slow rendering indicator

Postby TJ » 14 Dec 2015

You should add the TL_SetExtRight when you draw the TL.

Once you have drawn the TL,
you do not need to repeatedly declare the extension,
or to redefine the "end" location.
Remember, MultiCharts executes every statement on every tick. When you put the declaration in the same condition, you saved many processing cycles.

At the end of the week,
you can add the statements to
-- "end" the trendline,
-- stop the TL_SetExtRight so that the TL will not spill over to the next week.

User avatar
TomasD
Posts: 10
Joined: 04 Mar 2015
Location: Czech Republic, Central Europe
Has thanked: 3 times
Been thanked: 2 times

Re: Very slow rendering indicator

Postby TomasD » 15 Dec 2015

You should add the TL_SetExtRight when you draw the TL.

Once you have drawn the TL,
you do not need to repeatedly declare the extension,
or to redefine the "end" location.
Remember, MultiCharts executes every statement on every tick. When you put the declaration in the same condition, you saved many processing cycles.

At the end of the week,
you can add the statements to
-- "end" the trendline,
-- stop the TL_SetExtRight so that the TL will not spill over to the next week.
Thanks for the explanation helped me a lot.
I am faced with the last issue. When viewing a long history (in Figure), TL_line ending today and the wrong price. Rightly is to end next Tuesday from creation. Wednesday, then the new TL_line to the new price. I tried a variety of locations and conditions for tl_setend, but without result. Correct display them in the short history of 11 days (in Figure).

Code: Select all

Inputs:
IBW72.8(72.8), // %72,8
IBW27.2(27.2), // %27,2
IBW127.2(127.2), // %127,2
IBW161.8(161.8), // %161,8
IBW200(200), // %200
IBW227.2(227.2), // %227,2
IBW261.8(261.8), // %261,8
IBW300(300); // %300

variable:
IBWhigh(0), // high za pondeli a utery
IBWlow(0), // low za pondeli a utery
IBWrange(0),

IBW_72.8(0),
IBW_27.2(0),
IBW_127.2(0),
IBW_161.8(0),
IBW_200(0),
IBW_227.2(0),
IBW_261.8(0),
IBW_300(0),
IBW__127.2(0), // %-127,2
IBW__161.8(0), // %-161,8
IBW__200(0), // %-200
IBW__227.2(0), // %-227,2
IBW__261.8(0), // %-261,8
IBW__300(0), // %-300

IBWhighLine(0),
IBWlowLine(0),

IBW_72.8Line(0),
IBW_27.2Line(0),
IBW_127.2Line(0),
IBW_161.8Line(0),
IBW_200Line(0),
IBW_227.2Line(0),
IBW_261.8Line(0),
IBW_300Line(0),
IBW__127.2Line(0),
IBW__161.8Line(0),
IBW__200Line(0),
IBW__227.2Line(0),
IBW__261.8Line(0),
IBW__300Line(0),


IBWhighText(0),
IBWlowText(0),

IBW_72.8Text(0),
IBW_27.2Text(0),
IBW_127.2Text(0),
IBW_161.8Text(0),
IBW_200Text(0),
IBW_227.2Text(0),
IBW_261.8Text(0),
IBW_300Text(0),
IBW__127.2Text(0),
IBW__161.8Text(0),
IBW__200Text(0),
IBW__227.2Text(0),
IBW__261.8Text(0),
IBW__300Text(0),

Tmove(0),
y(0);


// podminky zaokrouhlovani na ruznych forex parech
if
symbol="EUR.USD" or
symbol="GBP.USD" or
symbol="USD.CHF" or
symbol="EUR.AUD" or
symbol="GBP.AUD" or
symbol="AUD.CAD" or
symbol="EUR.CAD" or
symbol="GBP.CAD" or
symbol="NZD.CAD" or
symbol="USD.CAD" or
symbol="AUD.CHF" or
symbol="CAD.CHF" or
symbol="EUR.CHF" or
symbol="GBP.CHF" or
symbol="NZD.CHF" or
symbol="EUR.GBP" or
symbol="AUD.NZD" or
symbol="EUR.NZD" or
symbol="GBP.NZD" or
symbol="AUD.USD" or
symbol="NZD.USD" or
symbol="AUD.SGD" or
symbol="EUR.SGD" or
symbol="USD.SGD" then begin

y=4;
end
else begin
y=2;
end;

// velikost posunut line a textu vzhledem soucasnemu baru

if
bartype=1 and
barinterval<>1 then
begin
Tmove=30;
end
else
begin
Tmove=2;
end;

// definice ze je streda a je treba urit high/low za pondeli a utery, tim zaroven range
if
dayofweek(date)=3 then
begin
IBWhigh=Round(maxlist(HighD(1),HighD(2)),y);
IBWlow=Round(minlist(LowD(1),LowD(2)),y);
IBWrange=IBWhigh-IBWlow;

// vapocet jednotlivych urovni
IBW_72.8=Round(IBWlow+(IBWrange*IBW72.8)/100,y); // %72,8
IBW_27.2=Round(IBWlow+(IBWrange*IBW27.2)/100,y); // %27,2
IBW_127.2=Round(IBWlow+(IBWrange*IBW127.2)/100,y); // %127,2
IBW_161.8=Round(IBWlow+(IBWrange*IBW161.8)/100,y); // %161,8
IBW_200=Round(IBWlow+(IBWrange*IBW200)/100,y); // %200
IBW_227.2=Round(IBWlow+(IBWrange*IBW227.2)/100,y); // %227,2
IBW_261.8=Round(IBWlow+(IBWrange*IBW261.8)/100,y); // %261,8
IBW_300=Round(IBWlow+(IBWrange*IBW300)/100,y); // %300

IBW__127.2=Round(IBWhigh-(IBWrange*IBW127.2)/100,y); // %-127,2
IBW__161.8=Round(IBWhigh-(IBWrange*IBW161.8)/100,y); // %-161,8
IBW__200=Round(IBWhigh-(IBWrange*IBW200)/100,y); // %-200
IBW__227.2=Round(IBWhigh-(IBWrange*IBW227.2)/100,y); // %-227,2
IBW__261.8=Round(IBWhigh-(IBWrange*IBW261.8)/100,y); // %-261,8
IBW__300=Round(IBWhigh-(IBWrange*IBW300)/100,y); // %-300

once
begin
/// nejvyssi high za pondeli a utery
IBWhighLine=tl_new(d[1],t[1],IBWhigh,d,t+Tmove,IBWhigh);
tl_setcolor(IBWhighLine,green);
tl_setextright(IBWhighLine,false);

IBWhighText=text_new(d,t+Tmove,IBWhigh,"IBW High ("+numtostr(IBWhigh,y)+")");
Text_SetStyle(IBWhighText, 0, 1 ) ;
Text_SetColor(IBWhighText,green);

end;
end;

tl_setend(IBWhighline,d,t+Tmove,IBWhigh);
text_setlocation(IBWhighText,d,t+Tmove,IBWhigh);
Attachments
30 and 11 days history.JPG
(215.26 KiB) Downloaded 799 times

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

Re: Very slow rendering indicator

Postby TJ » 15 Dec 2015

ONCE means "once".

ie Whatever is enclosed in the ONCE block will execute only once after you have applied the indicator to the chart. Once only, this block of code will not execute another time.

You can use it here:

Code: Select all

// podminky zaokrouhlovani na ruznych forex parech

Once
BEGIN

if
symbol="EUR.USD" or
symbol="GBP.USD" or
// etc
symbol="USD.SGD" then
begin
y=4;
end else
begin
y=2;
end;

if
bartype=1 and
barinterval<>1 then
begin
Tmove=30;
end else
begin
Tmove=2;
end;

END; // once

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

Re: Very slow rendering indicator

Postby TJ » 15 Dec 2015

Thanks for the explanation helped me a lot.
I am faced with the last issue. When viewing a long history (in Figure), TL_line ending today and the wrong price. Rightly is to end next Tuesday from creation. Wednesday, then the new TL_line to the new price. I tried a variety of locations and conditions for tl_setend, but without result. Correct display them in the short history of 11 days (in Figure).
Look up

TL_Setbegin



you should put both

tl_setend
TL_setBegin

inside the block where you calculate the TL position,
because once you have calculated the position, it does not change.
You should only leave the Text_Setlocation on the outside,
because it changes with every new bar.

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

Re: Very slow rendering indicator

Postby TJ » 15 Dec 2015

Good Coding Tip that can reduce your future debugging time.

When you have lots of codes and lots of conditions,
you should put the BEGIN and END at the very front, at the same indent level,
so that you can easily match the respective blocks.

eg.

Code: Select all


If A=B then
BEGIN // <-- this begin should have a matching END at the same indent level

if X=Y then
BEGIN // <-- this begin should have a matching END at the same indent level
{ do this work }
END;

END else
if C=D then
BEGIN

{ do this work }

END;

User avatar
TomasD
Posts: 10
Joined: 04 Mar 2015
Location: Czech Republic, Central Europe
Has thanked: 3 times
Been thanked: 2 times

Re: Very slow rendering indicator

Postby TomasD » 15 Dec 2015

Thanks for the explanation helped me a lot.
I am faced with the last issue. When viewing a long history (in Figure), TL_line ending today and the wrong price. Rightly is to end next Tuesday from creation. Wednesday, then the new TL_line to the new price. I tried a variety of locations and conditions for tl_setend, but without result. Correct display them in the short history of 11 days (in Figure).
Look up

TL_Setbegin



you should put both

tl_setend
TL_setBegin

inside the block where you calculate the TL position,
because once you have calculated the position, it does not change.
You should only leave the Text_Setlocation on the outside,
because it changes with every new bar.
I used once, tl_setbegin, tl_setend
but to draw the level occurs at the beginning of the chart and away anymore. I do not know how to draw a new level every Wednesday

Code: Select all

{
"Initial Balance Week" upraveno 16.12.2015 verze 0.9
}

Inputs:
IBW72.8(72.8), // %72,8
IBW27.2(27.2), // %27,2
IBW127.2(127.2), // %127,2
IBW161.8(161.8), // %161,8
IBW200(200), // %200
IBW227.2(227.2), // %227,2
IBW261.8(261.8), // %261,8
IBW300(300); // %300

variable:
IBWhigh(0), // high za pondeli a utery
IBWlow(0), // low za pondeli a utery
IBWrange(0),

IBW_72.8(0),
IBW_27.2(0),
IBW_127.2(0),
IBW_161.8(0),
IBW_200(0),
IBW_227.2(0),
IBW_261.8(0),
IBW_300(0),
IBW__127.2(0), // %-127,2
IBW__161.8(0), // %-161,8
IBW__200(0), // %-200
IBW__227.2(0), // %-227,2
IBW__261.8(0), // %-261,8
IBW__300(0), // %-300

IBWhighLine(0),
IBWlowLine(0),

IBW_72.8Line(0),
IBW_27.2Line(0),
IBW_127.2Line(0),
IBW_161.8Line(0),
IBW_200Line(0),
IBW_227.2Line(0),
IBW_261.8Line(0),
IBW_300Line(0),
IBW__127.2Line(0),
IBW__161.8Line(0),
IBW__200Line(0),
IBW__227.2Line(0),
IBW__261.8Line(0),
IBW__300Line(0),


IBWhighText(0),
IBWlowText(0),

IBW_72.8Text(0),
IBW_27.2Text(0),
IBW_127.2Text(0),
IBW_161.8Text(0),
IBW_200Text(0),
IBW_227.2Text(0),
IBW_261.8Text(0),
IBW_300Text(0),
IBW__127.2Text(0),
IBW__161.8Text(0),
IBW__200Text(0),
IBW__227.2Text(0),
IBW__261.8Text(0),
IBW__300Text(0),

Tmove(0),
y(0);



// podminky zaokrouhlovani na ruznych forex parech
once
begin
if
symbol="EUR.USD" or
symbol="GBP.USD" or
symbol="USD.CHF" or
symbol="EUR.AUD" or
symbol="GBP.AUD" or
symbol="AUD.CAD" or
symbol="EUR.CAD" or
symbol="GBP.CAD" or
symbol="NZD.CAD" or
symbol="USD.CAD" or
symbol="AUD.CHF" or
symbol="CAD.CHF" or
symbol="EUR.CHF" or
symbol="GBP.CHF" or
symbol="NZD.CHF" or
symbol="EUR.GBP" or
symbol="AUD.NZD" or
symbol="EUR.NZD" or
symbol="GBP.NZD" or
symbol="AUD.USD" or
symbol="NZD.USD" or
symbol="AUD.SGD" or
symbol="EUR.SGD" or
symbol="USD.SGD" then
begin

y=4;
end
else
begin
y=2;
end;
end;

// velikost posunu line a textu vzhledem soucasnemu baru
once
begin
if
bartype=1 and
barinterval<>1 then
begin
Tmove=30;
end
else
begin
Tmove=2;
end;
end;

// definice ze je streda a je treba urit high/low za pondeli a utery, tim zaroven range

if
dayofweek(date)=3 then
once
begin
IBWhigh=Round(maxlist(HighD(1),HighD(2)),y);
IBWlow=Round(minlist(LowD(1),LowD(2)),y);
IBWrange=IBWhigh-IBWlow;

// vapocet jednotlivych urovni
IBW_72.8=Round(IBWlow+(IBWrange*IBW72.8)/100,y); // %72,8
IBW_27.2=Round(IBWlow+(IBWrange*IBW27.2)/100,y); // %27,2
IBW_127.2=Round(IBWlow+(IBWrange*IBW127.2)/100,y); // %127,2
IBW_161.8=Round(IBWlow+(IBWrange*IBW161.8)/100,y); // %161,8
IBW_200=Round(IBWlow+(IBWrange*IBW200)/100,y); // %200
IBW_227.2=Round(IBWlow+(IBWrange*IBW227.2)/100,y); // %227,2
IBW_261.8=Round(IBWlow+(IBWrange*IBW261.8)/100,y); // %261,8
IBW_300=Round(IBWlow+(IBWrange*IBW300)/100,y); // %300

IBW__127.2=Round(IBWhigh-(IBWrange*IBW127.2)/100,y); // %-127,2
IBW__161.8=Round(IBWhigh-(IBWrange*IBW161.8)/100,y); // %-161,8
IBW__200=Round(IBWhigh-(IBWrange*IBW200)/100,y); // %-200
IBW__227.2=Round(IBWhigh-(IBWrange*IBW227.2)/100,y); // %-227,2
IBW__261.8=Round(IBWhigh-(IBWrange*IBW261.8)/100,y); // %-261,8
IBW__300=Round(IBWhigh-(IBWrange*IBW300)/100,y); // %-300
/// nejvyssi high za pondeli a utery
IBWhighLine=tl_new(d[1],t[1],IBWhigh,d,t+Tmove,IBWhigh);
tl_setcolor(IBWhighLine,green);
//tl_setextright(IBWhighLine,false);
tl_setbegin(IBWhighline,d,t+Tmove,IBWhigh);
tl_setend(IBWhighline,d+6,t+Tmove,IBWhigh);

IBWhighText=text_new(d,t+Tmove,IBWhigh,"IBW High ("+numtostr(IBWhigh,y)+")");
Text_SetStyle(IBWhighText, 0, 1 ) ;
Text_SetColor(IBWhighText,green);
text_setlocation(IBWhighText,d,t+Tmove,IBWhigh);

/// nejnizsi low za pondeli a utery
IBWlowLine=tl_new(d[1],t[1],IBWlow,d,t+Tmove,IBWlow);
tl_setcolor(IBWlowLine,red);
//tl_setextright(IBWlowLine,false);
tl_setbegin(IBWlowline,d,t+Tmove,IBWlow);
tl_setend(IBWlowline,d+6,t+Tmove,IBWlow);

IBWlowText=text_new(d,t+Tmove,IBWlow,"IBW Low ("+numtostr(IBWlow,y)+")");
Text_SetStyle(IBWlowText, 0, 1 ) ;
Text_SetColor(IBWlowText,red);
text_setlocation(IBWlowText,d,t+Tmove,IBWlow);

/// uroven %72.8
IBW_72.8Line=tl_new(d[1],t[1],IBW_72.8,d,t+Tmove,IBW_72.8);
tl_setcolor(IBW_72.8Line,RGB(255,255,0));
TL_setstyle(IBW_72.8Line,3);
//tl_setextright(IBW_72.8Line,false);
tl_setbegin(IBW_72.8Line,d,t+Tmove,IBW_72.8);
tl_setend(IBW_72.8Line,d+6,t+Tmove,IBW_72.8);

IBW_72.8Text=text_new(d,t+Tmove,IBW_72.8,"IBW %72.8 ("+numtostr(IBW_72.8,y)+")");
Text_SetStyle(IBW_72.8Text, 0, 1 ) ;
Text_SetColor(IBW_72.8Text,RGB(255,255,0));
text_setlocation(IBW_72.8Text,d,t+Tmove,IBW_72.8);

/// uroven %27.2
IBW_27.2Line=tl_new(d[1],t[1],IBW_27.2,d,t+Tmove,IBW_27.2);
tl_setcolor(IBW_27.2Line,RGB(131,111,255));
TL_setstyle(IBW_27.2Line,3);
//tl_setextright(IBW_27.2Line,false);
tl_setbegin(IBW_27.2line,d,t+Tmove,IBW_27.2);
tl_setend(IBW_27.2line,d+6,t+Tmove,IBW_27.2);

IBW_27.2Text=text_new(d,t+Tmove,IBW_27.2,"IBW %72.8 ("+numtostr(IBW_27.2,y)+")");
Text_SetStyle(IBW_27.2Text, 0, 1 ) ;
Text_SetColor(IBW_27.2Text,RGB(131,111,255));
text_setlocation(IBW_27.2Text,d,t+Tmove,IBW_27.2);

/// uroven %127.2
IBW_127.2Line=tl_new(d[1],t[1],IBW_127.2,d,t+Tmove,IBW_127.2);
tl_setcolor(IBW_127.2Line,RGB(192,255,255));
TL_setstyle(IBW_127.2Line,3);
//tl_setextright(IBW_127.2Line,false);
tl_setbegin(IBW_127.2line,d,t+Tmove,IBW_127.2);
tl_setend(IBW_127.2line,d+6,t+Tmove,IBW_127.2);

IBW_127.2Text=text_new(d,t+Tmove,IBW_127.2,"IBW %127.2 ("+numtostr(IBW_127.2,y)+")");
Text_SetStyle(IBW_127.2Text, 0, 1 ) ;
Text_SetColor(IBW_127.2Text,RGB(192,255,255));
text_setlocation(IBW_127.2Text,d,t+Tmove,IBW_127.2);

/// uroven %161.8
IBW_161.8Line=tl_new(d[1],t[1],IBW_161.8,d,t+Tmove,IBW_161.8);
tl_setcolor(IBW_161.8Line,RGB(192,255,255));
TL_setstyle(IBW_161.8Line,3);
//tl_setextright(IBW_161.8Line,false);
tl_setbegin(IBW_161.8line,d,t+Tmove,IBW_161.8);
tl_setend(IBW_161.8line,d+6,t+Tmove,IBW_161.8);

IBW_161.8Text=text_new(d,t+Tmove,IBW_161.8,"IBW %161.8 ("+numtostr(IBW_161.8,y)+")");
Text_SetStyle(IBW_161.8Text, 0, 1 ) ;
Text_SetColor(IBW_161.8Text,RGB(192,255,255));
text_setlocation(IBW_161.8Text,d,t+Tmove,IBW_161.8);

/// uroven %200
IBW_200Line=tl_new(d[1],t[1],IBW_200,d,t+Tmove,IBW_200);
tl_setcolor(IBW_200Line,RGB(255,192,203));
TL_setstyle(IBW_200Line,3);
//tl_setextright(IBW_200Line,false);
tl_setbegin(IBW_200line,d,t+Tmove,IBW_200);
tl_setend(IBW_200line,d+6,t+Tmove,IBW_200);

IBW_200Text=text_new(d,t+Tmove,IBW_200,"IBW %200 ("+numtostr(IBW_200,y)+")");
Text_SetStyle(IBW_200Text, 0, 1 ) ;
Text_SetColor(IBW_200Text,RGB(255,192,203));
text_setlocation(IBW_200Text,d,t+Tmove,IBW_200);

/// uroven %227.2
IBW_227.2Line=tl_new(d[1],t[1],IBW_227.2,d,t+Tmove,IBW_227.2);
tl_setcolor(IBW_227.2Line,RGB(192,255,255));
TL_setstyle(IBW_227.2Line,3);
//tl_setextright(IBW_227.2Line,false);
tl_setbegin(IBW_227.2line,d,t+Tmove,IBW_227.2);
tl_setend(IBW_227.2line,d+6,t+Tmove,IBW_227.2);

IBW_227.2Text=text_new(d,t+Tmove,IBW_227.2,"IBW %227.2 ("+numtostr(IBW_227.2,y)+")");
Text_SetStyle(IBW_227.2Text, 0, 1 ) ;
Text_SetColor(IBW_227.2Text,RGB(192,255,255));
text_setlocation(IBW_227.2Text,d,t+Tmove,IBW_227.2);

/// uroven %261.8
IBW_261.8Line=tl_new(d[1],t[1],IBW_261.8,d,t+Tmove,IBW_261.8);
tl_setcolor(IBW_261.8Line,RGB(192,255,255));
TL_setstyle(IBW_261.8Line,3);
tl_setbegin(IBW_261.8line,d,t+Tmove,IBW_261.8);
tl_setend(IBW_261.8line,d+6,t+Tmove,IBW_261.8);

IBW_261.8Text=text_new(d,t+Tmove,IBW_261.8,"IBW %261.8 ("+numtostr(IBW_261.8,y)+")");
Text_SetStyle(IBW_261.8Text, 0, 1 ) ;
Text_SetColor(IBW_261.8Text,RGB(192,255,255));
//tl_setextright(IBW_261.8Line,false);
text_setlocation(IBW_261.8Text,d,t+Tmove,IBW_261.8);

/// uroven %300
IBW_300Line=tl_new(d[1],t[1],IBW_300,d,t+Tmove,IBW_300);
tl_setcolor(IBW_300Line,RGB(165,42,0));
TL_setstyle(IBW_300Line,3);
//tl_setextright(IBW_300Line,false);
tl_setbegin(IBW_300line,d,t+Tmove,IBW_300);
tl_setend(IBW_300line,d+6,t+Tmove,IBW_300);

IBW_300Text=text_new(d,t+Tmove,IBW_300,"IBW %300 ("+numtostr(IBW_300,y)+")");
Text_SetStyle(IBW_300Text, 0, 1 ) ;
Text_SetColor(IBW_300Text,RGB(165,42,0));
text_setlocation(IBW_300Text,d,t+Tmove,IBW_300);



/// uroven %-127.2
IBW__127.2Line=tl_new(d[1],t[1],IBW__127.2,d,t+Tmove,IBW__127.2);
tl_setcolor(IBW__127.2Line,RGB(192,255,255));
TL_setstyle(IBW__127.2Line,3);
//tl_setextright(IBW__127.2Line,false);
tl_setbegin(IBW__127.2line,d,t+Tmove,IBW__127.2);
tl_setend(IBW__127.2line,d+6,t+Tmove,IBW__127.2);

IBW__127.2Text=text_new(d,t+Tmove,IBW__127.2,"IBW %-127.2 ("+numtostr(IBW__127.2,y)+")");
Text_SetStyle(IBW__127.2Text, 0, 1 ) ;
Text_SetColor(IBW__127.2Text,RGB(192,255,255));
text_setlocation(IBW__127.2Text,d,t+Tmove,IBW__127.2);

/// uroven %-161.8
IBW__161.8Line=tl_new(d[1],t[1],IBW__161.8,d,t+Tmove,IBW__161.8);
tl_setcolor(IBW__161.8Line,RGB(192,255,255));
TL_setstyle(IBW__161.8Line,3);
//tl_setextright(IBW__161.8Line,false);
tl_setbegin(IBW__161.8line,d,t+Tmove,IBW__161.8);
tl_setend(IBW__161.8line,d+6,t+Tmove,IBW__161.8);

IBW__161.8Text=text_new(d,t+Tmove,IBW__161.8,"IBW %-161.8 ("+numtostr(IBW__161.8,y)+")");
Text_SetStyle(IBW__161.8Text, 0, 1 ) ;
Text_SetColor(IBW__161.8Text,RGB(192,255,255));
text_setlocation(IBW__161.8Text,d,t+Tmove,IBW__161.8);

/// uroven %-200
IBW__200Line=tl_new(d[1],t[1],IBW__200,d,t+Tmove,IBW__200);
tl_setcolor(IBW__200Line,RGB(255,192,203));
TL_setstyle(IBW__200Line,3);
//tl_setextright(IBW__200Line,false);
tl_setbegin(IBW__200line,d,t+Tmove,IBW__200);
tl_setend(IBW__200line,d+6,t+Tmove,IBW__200);

IBW__200Text=text_new(d,t+Tmove,IBW__200,"IBW %-200 ("+numtostr(IBW__200,y)+")");
Text_SetStyle(IBW__200Text, 0, 1 ) ;
Text_SetColor(IBW__200Text,RGB(255,192,203));
text_setlocation(IBW__200Text,d,t+Tmove,IBW__200);

/// uroven %-227.2
IBW__227.2Line=tl_new(d[1],t[1],IBW__227.2,d,t+Tmove,IBW__227.2);
tl_setcolor(IBW__227.2Line,RGB(192,255,255));
TL_setstyle(IBW__227.2Line,3);
//tl_setextright(IBW__227.2Line,false);
tl_setbegin(IBW__227.2line,d,t+Tmove,IBW__227.2);
tl_setend(IBW__227.2line,d+6,t+Tmove,IBW__227.2);

IBW__227.2Text=text_new(d,t+Tmove,IBW__227.2,"IBW %-227.2 ("+numtostr(IBW__227.2,y)+")");
Text_SetStyle(IBW__227.2Text, 0, 1 ) ;
Text_SetColor(IBW__227.2Text,RGB(192,255,255));
text_setlocation(IBW__227.2Text,d,t+Tmove,IBW__227.2);

/// uroven %-261.8
IBW__261.8Line=tl_new(d[1],t[1],IBW__261.8,d,t+Tmove,IBW__261.8);
tl_setcolor(IBW__261.8Line,RGB(192,255,255));
TL_setstyle(IBW__261.8Line,3);
//tl_setextright(IBW__261.8Line,false);
tl_setbegin(IBW__261.8line,d,t+Tmove,IBW__261.8);
tl_setend(IBW__261.8line,d+6,t+Tmove,IBW__261.8);

IBW__261.8Text=text_new(d,t+Tmove,IBW__261.8,"IBW %-261.8 ("+numtostr(IBW__261.8,y)+")");
Text_SetStyle(IBW__261.8Text, 0, 1 ) ;
Text_SetColor(IBW__261.8Text,RGB(192,255,255));
text_setlocation(IBW__261.8Text,d,t+Tmove,IBW__261.8);

/// uroven %-300
IBW__300Line=tl_new(d[1],t[1],IBW__300,d,t+Tmove,IBW__300);
tl_setcolor(IBW__300Line,RGB(165,42,0));
TL_setstyle(IBW__300Line,3);
//tl_setextright(IBW__300Line,false);
tl_setbegin(IBW__300line,d,t+Tmove,IBW__300);
tl_setend(IBW__300line,d+6,t+Tmove,IBW__300);

IBW__300Text=text_new(d,t+Tmove,IBW__300,"IBW %-300 ("+numtostr(IBW__300,y)+")");
Text_SetStyle(IBW__300Text, 0, 1 ) ;
Text_SetColor(IBW__300Text,RGB(165,42,0));
text_setlocation(IBW__300Text,d,t+Tmove,IBW__300);
end;
Attachments
start chart.JPG
(221.31 KiB) Downloaded 804 times

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

Re: Very slow rendering indicator

Postby TJ » 15 Dec 2015

This thread might be of help to you.

viewtopic.php?f=5&t=4025

User avatar
TomasD
Posts: 10
Joined: 04 Mar 2015
Location: Czech Republic, Central Europe
Has thanked: 3 times
Been thanked: 2 times

Re: Very slow rendering indicator  [SOLVED]

Postby TomasD » 16 Dec 2015

This thread might be of help to you.

viewtopic.php?f=5&t=4025
Good link.
I had to calculate TL leave without ONCE and add before DayOfWeek condition for a new day.


I thank TJ for the great help.
The code I have done and it works great.
Attachments
Initial Balance Week.pla
(36.02 KiB) Downloaded 296 times

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

Re: Very slow rendering indicator

Postby TJ » 16 Dec 2015

This thread might be of help to you.

viewtopic.php?f=5&t=4025
Good link.
I had to calculate TL leave without ONCE and add before DayOfWeek condition for a new day.


I thank TJ for the great help.
The code I have done and it works great.
I am glad it worked out.

Thanks for sharing your code.

Cheers!


Return to “MultiCharts”