Error: Missing data on a function to draw a trend line ???  [SOLVED]

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Error: Missing data on a function to draw a trend line ???

Postby arjfca » 19 Mar 2014

Hello

A simple function to draw a trend line that is following the price marker ( close ) is reporting an error of Missing Data. I don't see nothing that need to specify witch data in use. Only one instrument on the chart

Once enable in the main indicator, the function is called
Martin


The line from my main indicator

Code: Select all

If ShowPriceline_ = true then showPriceline;
The function
ShowPriceLine

Code: Select all

//Display a line that follow that Price marker

Var:
Intrabarpersist TL (0);

Once begin
tl = Tl_New_BN(Barnumber,close ,barnumber,close );
tl_setextleft(TL,true);
tl_setextright(TL,true);
end;

Value1 = TL_Setbegin_BN(TL, barnumber,close);

//ShowPriceline = 1;
Attachments
Missing Data.jpg
(21.86 KiB) Downloaded 553 times

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

Re: Error: Missing data on a function to draw a trend line ?

Postby TJ » 19 Mar 2014

If you have looked at my codes,
you will recall that I always initialize a drawing object variable to -1.

Code: Select all

var:
TL(-1);

ps. this is not the problem, but it helps you to debug.

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

Re: Error: Missing data on a function to draw a trend line ?

Postby TJ » 19 Mar 2014

Image

This means "There is no such a drawing object."

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Error: Missing data on a function to draw a trend line ?

Postby arjfca » 20 Mar 2014

If you have looked at my codes,
you will recall that I always initialize a drawing object variable to -1.

Code: Select all

var:
TL(-1);

ps. this is not the problem, but it helps you to debug.
I did put a print of TL just before exiting the function and the Trend line is created and initialized to 3.

Quest continue
Thanks for your input, always appreciated
Good idea for the initialization. I will try to remember to use it

Martin

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Resolve Missing data on a function to draw a trend line ???  [SOLVED]

Postby arjfca » 20 Mar 2014

Hello TG

I put the Trend line creation code in the main indicator and reference it to the function

If ShowPriceline_ = true and lastbaronchart_s then showPriceline(tl);


This little code allow me to display an horizontal line that is following the price cursor. It is include in my indicator "MouseClick". When I click at a given place in the right margin, the line appear, click in the same region, line is off

I have created 5 regions that I call buttons. This allow me to trigger different function from the click

Martin


Return to “MultiCharts”