Indicator eventually stops plotting

Questions about MultiCharts and user contributed studies.
Ulich05
Posts: 26
Joined: 02 Aug 2011
Has thanked: 2 times
Been thanked: 10 times

Indicator eventually stops plotting

Postby Ulich05 » 13 Nov 2011

I've had this issue happen before where an indicator will stop plotting and begin to output random numbers and letters to the power language editor output bar. The indicators that are doing this are custom pivot levels and various different indicators for pairs trading.

in the past ive fixed it by recreating all my workspaces from scratch 1 by 1. none of these indicators have any code that would intentionally make them output anything to the output bar especially not purely random data.

tonight FX pivots stopped plotting and began outputting
10
10
11
11

to the output bar. Those #s have nothing to do with the code anywhere. is this a dll issue somewhere? I can't see how this would be indicator code since they're not even coded to send anything to the output bar and work fine the bulk of the time and work fine again when the workspaces are recreated.

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

Re: Indicator eventually stops plotting

Postby TJ » 13 Nov 2011

I've had this issue happen before where an indicator will stop plotting and begin to output random numbers and letters to the power language editor output bar. The indicators that are doing this are custom pivot levels and various different indicators for pairs trading.

in the past ive fixed it by recreating all my workspaces from scratch 1 by 1. none of these indicators have any code that would intentionally make them output anything to the output bar especially not purely random data.

tonight FX pivots stopped plotting and began outputting
10
10
11
11

to the output bar. Those #s have nothing to do with the code anywhere. is this a dll issue somewhere? I can't see how this would be indicator code since they're not even coded to send anything to the output bar and work fine the bulk of the time and work fine again when the workspaces are recreated.
can't help you much without seeing the code.

Ulich05
Posts: 26
Joined: 02 Aug 2011
Has thanked: 2 times
Been thanked: 10 times

Re: Indicator eventually stops plotting

Postby Ulich05 » 13 Nov 2011

heres an example

Code: Select all

inputs: output(false), Size1(1), Size2(1), NumDevsUp(2), NumDevsDn(2), Length(20), Multiplier1(1000), Multiplier2(1000),
usealrthi(false),usealrtlo(false),targethi(0), Targetlo(0), plotbands(false),tarhi(0), tarlo(0);

vars: s1(0), s2(0), avg(0), Sdev(0), UpperBand(0), LowerBand(0),TradeStr1(""), FileNamefull("") ;

input:
Data_A_Num ( 1 ) ,
Data_B_Num ( 2 ) ;

var:
OO ( 0 ) ,
HH ( 0 ) ,
LL ( 0 ) ,
CC ( 0 ) ,
O_A ( 0 ) ,
H_A ( 0 ) ,
L_A ( 0 ) ,
C_A ( 0 ) ,
O_B ( 0 ) ,
H_B ( 0 ) ,
L_B ( 0 ) ,
C_B ( 0 ) ,
C_Data_A ( 0 ) ,
C_Data_B ( 0 ) ,
IntraBarPersist i_OO ( 0 ) ,
IntraBarPersist i_HH ( 0 ) ,
IntraBarPersist i_LL ( 0 ) ,
IntraBarPersist i_CC ( 0 ) ,
IntraBarPersist i_C_Data_A ( 0 ) ,
IntraBarPersist i_C_Data_B ( 0 ) ,
IntraBarPersist value1 ( 0 ) ,
IntraBarPersist BarNum ( 0 ) ;


s1 = Size1 *(Multiplier1 * Close data1);
s2 = Size2 * (Multiplier2 * Close data2);
if output then begin
print("s1 is " + NumToStr(size1,0) + " * "+ NumToStr(Multiplier1,0) +" * " + NumToStr(Close data1,7)+" = " + NumToStr(s1,2) );
print("s2 is " + NumToStr(size2,0) + " * "+ NumToStr(Multiplier2,0) +" * " + NumToStr(Close data2,2)+" = " + NumToStr(s2,2) ); end;
value1 = s1-s2;
If plotbands then begin
avg = AverageFC( value1, Length ) ;
SDev = StandardDev( value1, Length, 1 ) ;
UpperBand = avg + NumDevsUp * SDev ;
LowerBand = avg - NumDevsDn * SDev ;

plot6(avg, "Avg");
plot7(UpperBand, "upper");
plot8(LowerBand, "lower");
end;
i_C_Data_A = close data(Data_A_Num) ;
i_C_Data_B = close data(Data_B_Num) ;


//Spread = i_C_Data_A - i_C_Data_B ;

if GetAppInfo( aiRealTimeCalc ) = 1 then //------ realtime tick-by-tic spread ---------
begin
if BarNum <> CurrentBar then
begin
i_HH = value1 ;
i_LL = value1 ;
i_OO = value1 ;
BarNum = CurrentBar ;
end else
begin
if value1 > i_HH then
i_HH = value1 ;
if value1 < i_LL then
i_LL = value1 ;
i_CC = value1 ;
end ;

//Plot1( i_CC, "RightTic") ;
Plot1(value1, "Spread");
Plot2( i_HH, "HighBar", iff( i_OO > 0, green, red ) ) ;
Plot3( i_LL, "LowBar", iff( i_OO > 0, green, red ) ) ;
Plot4( i_OO, "LeftTick") ;
Plot5( i_CC, "RightTic") ;

end else
begin //------------ historical calcs ------------------

O_A = size1 *(Open Data(Data_A_Num) *Multiplier1) ; O_B = size2 * (Open Data(Data_B_Num)*Multiplier2 );
H_A = size1 * (High Data(Data_A_Num) *Multiplier1); H_B = size2* (High Data(Data_B_Num) *Multiplier2 );
L_A = size1 * (Low Data(Data_A_Num)*Multiplier1 ); L_B = size2 * (Low Data(Data_B_Num) *Multiplier2 );
C_A = size1 * (Close Data(Data_A_Num) *Multiplier1); C_B = size2* (Close Data(Data_B_Num) *Multiplier2 );
OO = O_A - O_B ;
HH = H_A - H_B ;
LL = L_A - L_B ;
CC = C_A - C_B ;





Plot1(value1, "spread");
//Plot2( HH, "HighBar", iff( OO > 0, green, red ) ) ;
//Plot3( LL, "LowBar", iff( OO > 0, green, red ) ) ;
//Plot4( OO, "LeftTick" ) ;
//Plot5( value1, "RightTic") ;

end ;


variables:
Text_ID( 0 ) ,
RightDateTime( 0 ) ,
LowValue( 0 ) ,
local(0), vol(0), txt(""), myvol(0);


txt = Numtostr(value1, 2);

if CurrentBar = 1 then
begin
Text_ID = Text_New( Date, Time, Close, " " ) ;
Text_SetStyle( Text_ID, 1, 1 ) ;
end ;

if LastBarOnChart then
begin
RightDateTime = GetAppInfo( aiRightDispDateTime ) ;
Lowvalue = GetAppInfo( aiLowestDispValue ) ;
value2 = Text_SetString( Text_ID, txt );
Text_SetLocation( Text_ID, JulianToDate( IntPortion( RightDateTime ) ), MinutesToTime( FracPortion( RightDateTime ) * 60 * 24 ), Lowvalue ) ;
end ;

if usealrthi and value1 >= tarhi then alert("Target Hi");
If usealrtlo and value1 <= tarlo then alert("Target Lo");

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Indicator eventually stops plotting

Postby Henry MultiСharts » 14 Nov 2011

Please attach the workspace you are using for futher investigation.


Return to “MultiCharts”