SetProfitTargetPt(n). n is always Positive?  [SOLVED]

Questions about MultiCharts and user contributed studies.
Luto
Posts: 9
Joined: 18 May 2022
Has thanked: 3 times

SetProfitTargetPt(n). n is always Positive?

Postby Luto » 08 Jun 2022

Hi Guys,

It appears one cannot pass SetProfitTarget_pt a negative value.

Example:

If true then setprofittarget_pt (-5);

The above gets interpreted as "SetProfitTarget_pt(5)", i.e. positive.

I guess the workaround is to use setprofittarget(p), where p is the price minus some amount.

E.g:

If True then setprofittarget ( Entryprice - 5);

All comments welcome.

User avatar
Svetlana MultiCharts
Posts: 645
Joined: 19 Oct 2017
Has thanked: 3 times
Been thanked: 163 times

Re: SetProfitTargetPt(n). n is always Positive?

Postby Svetlana MultiCharts » 14 Jun 2022

It is possible to use a negative value.
If you face a different behaviour, please send a test case demonstrating it:
1. The workspace where the behaviour is reproduced.
2. Export of used symbols (with data) from QuoteManager in .qmd archive.
3. The exported scripts with all dependent functions that are used on the workspace. Please reproduce the behaviour on simplified signals.

Luto
Posts: 9
Joined: 18 May 2022
Has thanked: 3 times

Re: SetProfitTargetPt(n). n is always Positive?

Postby Luto » 14 Jun 2022

Thanks for the reply Svetlana, I will do more testing as time allows and post when I get results. Thanks again for the simple reply.

Luto
Posts: 9
Joined: 18 May 2022
Has thanked: 3 times

Re: SetProfitTargetPt(n). n is always Positive?  [SOLVED]

Postby Luto » 25 Jun 2022

Thanks, I verified it works as expected.


Return to “MultiCharts”