TS vs MC strategy behavior  [SOLVED]

Questions about MultiCharts and user contributed studies.
firemag
Posts: 21
Joined: 15 Sep 2017
Been thanked: 2 times

TS vs MC strategy behavior

Postby firemag » 30 Oct 2017

I have a strategy that uses both "SetStopLoss()" as well as will place its own buy-stop or sell-stop based on volume.

In the strategy I have:

Code: Select all

If ( VolumeVal > AvgV ) then
begin
   if ( MarketPosition <> 1 ) then
      Buy next bar at Close + BreakoutPoints stop;

   if ( MarketPosition <> -1 ) then
      Sellshort next bar at Close - BreakoutPoints stop ;
end;

SetStopLoss( StopLossDollars );


TS seems to handle this by having only one stop active at any one time. MC seems to have both stop orders active.

The same trade in TS (only one stop):

2017-10-30_11-56-22.jpg
2017-10-30_11-56-22.jpg (66.69 KiB) Viewed 141 times


The same trade in MC (multiple stops)... the stop at 1.2420 is due to the buy-stop line in the code and the stop at 1.2240 is due to the SetStopLoss() line of code.

2017-10-30_11-44-06.jpg
2017-10-30_11-44-06.jpg (219.92 KiB) Viewed 142 times


I'd like the strategy to mirror TS's behavior. Is there a way to match TS's behavior using MC settings, or do I need to do this in the strategy/signal code?

User avatar
Anna MultiCharts
Posts: 74
Joined: 14 Jul 2017
Has thanked: 2 times
Been thanked: 14 times

Re: TS vs MC strategy behavior

Postby Anna MultiCharts » 06 Nov 2017

Hello, firemag!

According to the script and screenshots you provided the orders are sent simultaneously because both conditions are met. If you don’t need SellShort to be sent after a position is opened, you need to adjust your code accordingly.

firemag
Posts: 21
Joined: 15 Sep 2017
Been thanked: 2 times

Re: TS vs MC strategy behavior  [SOLVED]

Postby firemag » 06 Nov 2017

Anna MultiCharts wrote:According to the script and screenshots you provided the orders are sent simultaneously because both conditions are met. If you don’t need SellShort to be sent after a position is opened, you need to adjust your code accordingly.
Thanks, Anna. That's kind of what I figured. TS has a different way of handling this, so I'll just have to code it to emulate.


Return to “MultiCharts”