How to use different monetary stop losses on same chart with the built-in setstoploss

Questions about MultiCharts and user contributed studies.
verbi22
Posts: 1
Joined: 29 Mar 2014

How to use different monetary stop losses on same chart with the built-in setstoploss

Postby verbi22 » 24 Nov 2019

I have verified that if on the same chart, I use two signals with different monetary value of the stop loss, the built-in stop reserved setstoploss, in fact for both signals the stop loss of lower value is always used.
Example:

*** Strategy A
input: stopLossA (500)
** Code
setstopcontract;
if (stopLossA> 0) then setstoploss (stopLossA);

*** Strategy B
input: stopLossB (1000)
** Code
setstopcontract;
if (stopLossB> 0) then setstoploss (stopLossB);

In the example for the two strategies active on the same graph, the StopLossA is also used incorrectly for Strategy B.

I need two or more signals to be on the same chart to use the MC optimization engine, to find an optimal combination of two or more strategies.

Could global variables solve the problem?
Do you have other solutions to suggest?

Thank you in advance for your attention

Verbi22

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

Re: How to use different monetary stop losses on same chart with the built-in setstoploss

Postby TJ » 24 Nov 2019

See post #5
[FAQ] Built-In Stops / Profit Targets / OCO Orders
viewtopic.php?t=10811


Return to “MultiCharts”