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
How to use different monetary stop losses on same chart with the built-in setstoploss
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times