Optimizing Boolean Parameters

Questions about MultiCharts and user contributed studies.
quantarb
Posts: 51
Joined: 14 Apr 2012
Has thanked: 9 times
Been thanked: 33 times

Optimizing Boolean Parameters

Postby quantarb » 20 Oct 2012

Optimizing Boolean Parameters
Hello, I am wondering how I go about optimizing Boolean parameters.

Ex.
I’m trying to find if the optimal value is true or false.
If condition1 = true then buy vs if condition1 = false then buy.

Any ideas?

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

Re: Optimizing Boolean Parameters

Postby TJ » 20 Oct 2012

Optimizing Boolean Parameters
Hello, I am wondering how I go about optimizing Boolean parameters.

Ex.
I’m trying to find if the optimal value is true or false.
If condition1 = true then buy vs if condition1 = false then buy.

Any ideas?
eg.

Code: Select all

If condition1 = true then BUY
else
if condition1 = false then BUY;

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

Re: Optimizing Boolean Parameters

Postby TJ » 20 Oct 2012

Optimizing Boolean Parameters
Hello, I am wondering how I go about optimizing Boolean parameters.

Ex.
I’m trying to find if the optimal value is true or false.
If condition1 = true then buy vs if condition1 = false then buy.

Any ideas?
You can make the condition numeric.

eg.

Code: Select all

If LogicA = 1 then BUY
else
if LogicA = 0 then BUY;

ps. MultiCharts can optimize your strategy for you, using either True/False or numeric logic.

quantarb
Posts: 51
Joined: 14 Apr 2012
Has thanked: 9 times
Been thanked: 33 times

Re: Optimizing Boolean Parameters

Postby quantarb » 22 Oct 2012

Hello TJ,

Thank you for your suggestion. I came up with the following solution. I can then find whether the optimal value is one or zero.

Input: Strategy(0);

if Strategy <> 0 then
begin
condition99 = "insert your condition"
Else
begin
Condition99 = true;
end;

If MarketPosition = 0 and Condition99 then


Return to “MultiCharts”