[PL] "lower than" problem

Questions about MultiCharts and user contributed studies.
duration
Posts: 175
Joined: 20 Dec 2005

[PL] "lower than" problem

Postby duration » 24 Mar 2010

Dear All,

I am using the latest beta.

I am having a problem with powerlanguage.

The signal roughly goes:

Code: Select all

if redgreenline < 78 then arw_new(date,time,high,true);


and I get an arrow although the line is not below 78, but equals 80.

I also tried "crosses below/under" and it stilll gives me an arrow.

If I write:

Code: Select all

if redgreenline < 57 then arw_new(date,time,high,true);


It does not give me an arrow.

If I write:

Code: Select all

if redgreenline < 58 then arw_new(date,time,high,true);


Then it gives me an arrow.

Although the value of the redgreenline clearly equals 80, MC seems to think it is equal to somewhere between 57 & 58...................

What is the problem in your opinion?

Many thanks,
Last edited by duration on 25 Mar 2010, edited 2 times in total.

User avatar
TJ
Posts: 6550
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 965 times
Been thanked: 1892 times

Postby TJ » 24 Mar 2010

this does not seem right.


can you put this on the arrow?

arw_settext( id.arw, text(redgreenline) );

it should tell you quickly where the line is.

User avatar
TJ
Posts: 6550
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 965 times
Been thanked: 1892 times

Postby TJ » 25 Mar 2010

I tested your logic with arrows on stochastic.

everything seems to be ok.

pls see the attached for code and result.
Attachments
arw test.txt
(1.2 KiB) Downloaded 22 times
arw test hsi.jpg
arw test hsi.jpg (142.56 KiB) Viewed 263 times

duration
Posts: 175
Joined: 20 Dec 2005

Postby duration » 25 Mar 2010

Dear TJ,

Thank you for your reply, this is a very good idea.

It gives 57.14.

There is definitely something wrong somewhere with what I wrote, although the signal uses 100% the same code as the indicator......

Thanks again for your idea, it helps a lot for troubleshooting.

By the way, would you know how to make text() display 4 digits after the decimal separator?

Many thanks,

User avatar
TJ
Posts: 6550
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 965 times
Been thanked: 1892 times

Postby TJ » 25 Mar 2010

...
By the way, would you know how to make text() display 4 digits after the decimal separator?

Many thanks,



arw_settext( id.arw, text(redgreenline:0:4) );

duration
Posts: 175
Joined: 20 Dec 2005

Postby duration » 25 Mar 2010

Dear TJ,

Thank you again for your kind reply.

Actually, thanks to you, I have found what the problem is: instead of plotting the arrow above the candle where the conditions are met (cross under overbought), it plots it above the candle before...

How can you make MC plot above the candle where the condition is met, and not the one before?

Many thanks,

User avatar
TJ
Posts: 6550
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 965 times
Been thanked: 1892 times

Postby TJ » 25 Mar 2010

Dear TJ,

Thank you again for your kind reply.

Actually, thanks to you, I have found what the problem is: instead of plotting the arrow above the candle where the conditions are met (cross under overbought), it plots it above the candle before...

How can you make MC plot above the candle where the condition is met, and not the one before?

Many thanks,


I am not sure if I understand your question.
You can read my code for reference.

duration
Posts: 175
Joined: 20 Dec 2005

Postby duration » 25 Mar 2010

Dear TJ,

Sorry if I am not clear.

Please have a look at the new screenshot below.

It seems that the arrow is plotted on bar in advance.

Do you know why?

Many thanks,
Attachments
lowerthanproblem.png
lowerthanproblem.png (98.5 KiB) Viewed 245 times

User avatar
TJ
Posts: 6550
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 965 times
Been thanked: 1892 times

Postby TJ » 25 Mar 2010

maybe your plot has an offset ?

duration
Posts: 175
Joined: 20 Dec 2005

Postby duration » 25 Mar 2010

no offset anywhere...

User avatar
TJ
Posts: 6550
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 965 times
Been thanked: 1892 times

Postby TJ » 25 Mar 2010

without seeing your code, it is difficult to comment.

my arrows fired off perfectly.
you can compare your code to mine...
see if you can spot any logical differences.

duration
Posts: 175
Joined: 20 Dec 2005

Postby duration » 25 Mar 2010

Dear TJ,

I have already compared your code to mine.

They are similar and the logic is the same in any case and it displays the arrow and this 57.14 one bar in advance..... some of them display fine, some of them even display 2 bars before....

I am going to contact TS Support directly about this.

Many thanks,
Last edited by duration on 25 Mar 2010, edited 2 times in total.

User avatar
TJ
Posts: 6550
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 965 times
Been thanked: 1892 times

Postby TJ » 25 Mar 2010

you are welcome.


Return to “MultiCharts”