Problem with input parameter of type true/false  [SOLVED]

Questions about MultiCharts and user contributed studies.
Trader M
Posts: 8
Joined: 06 Jan 2017
Has thanked: 4 times

Problem with input parameter of type true/false

Postby Trader M » 19 Apr 2017

Hi all,

I use boolean input parameters to control stop loss or profit target.
For example for stop loss:

- UseStopLoss (true/false)
- StopLossAmount (value in USD)

In optimization a stop is only used if UseStopLoss = true.

My problem is that:
Assume the current setting is UseStopLoss = true and StopLossAmount = 400. I run optimization in portfolio trader and get a result. Fine.
Afterwards I change the value of UseStopLoss to false and run optimization again. But the result is still the same that uses a stop loss. When checking the input parameters I see that the value is true again instead of false. Only if I set false again and run optimization again the strategy doesn't use a stop. This is especially annoying if the optimization takes very long.
My current workaround is to set from true to false, start the optimization, cancel the optimization, set the value again to false. But sometimes I forget and only at a very late stage I notice that the analysis was based on "wrong" assumptions.
Why is the parameter only taken at the second time I change it, not at the first one?

It seems only to happen for boolean values, not for any others.

Does anyone have an idea?

Appreciated your feedback.
Thanks!
Trader M

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Problem with input parameter of type true/false

Postby ABC » 19 Apr 2017

Trader M,

while what you experience doesn't sound like it is intended behavior, as a workaround you can
make the inputs numeric - 0 for false, 1 for true.

Regards,

ABC

Trader M
Posts: 8
Joined: 06 Jan 2017
Has thanked: 4 times

Re: Problem with input parameter of type true/false  [SOLVED]

Postby Trader M » 19 Apr 2017

Hi ABC,

thanks for your comment.
Yes, I guess if there's no other solution I will convert everything from true/false to 1/0.

Regards
Trader M


Return to “MultiCharts”