setstoploss( stopPoints * bigpointvalue); with 20 points but I got stopped with 39 !!! How's possible??

Questions about MultiCharts and user contributed studies.
dvdkite
Posts: 24
Joined: 16 May 2018
Has thanked: 3 times

setstoploss( stopPoints * bigpointvalue); with 20 points but I got stopped with 39 !!! How's possible??

Postby dvdkite » 17 May 2019

Hello Everyone,

The question is very very simple.
I'm backtesting a strategy WITH IOG that uses the zig zig swings to perferm entries and I'm using fixed stop loss and target (20 and 10 points).
So By using the

Code: Select all

setstoploss( stopPoints * bigpointvalue);
with 20 points but I got stopped with 39 in my backtest!!!

How's possible??

I can post the code I'm using if you wish but the setstoploss( stopPoints * bigpointvalue) is indipendent and it should send a stop order to the broker as soon as the position is opened so why this result in my backtest??

STOPPED39DAX_SETTINGS.JPG
STOPPED39DAX_SETTINGS.JPG (16.5 KiB) Viewed 133 times


STOPPED39DAX.JPG
STOPPED39DAX.JPG (126.05 KiB) Viewed 133 times



I've never seen something like this before.

Regards,

David

wilkinsw
Posts: 503
Joined: 21 Apr 2013
Has thanked: 129 times
Been thanked: 82 times

Re: setstoploss( stopPoints * bigpointvalue); with 20 points but I got stopped with 39 !!! How's possible??

Postby wilkinsw » 18 May 2019

Out of interest what Bar Magnifier settings are you using in conjunction with this IOG backtest?

I suspect you've been stopped out at the next available data point (next bar open) which happens to be greater than your stop.

I would take a guess that your Bar magnifier setting isn't granular enough.
These users thanked the author wilkinsw for the post:
dvdkite

dvdkite
Posts: 24
Joined: 16 May 2018
Has thanked: 3 times

Re: setstoploss( stopPoints * bigpointvalue); with 20 points but I got stopped with 39 !!! How's possible??

Postby dvdkite » 20 May 2019

wilkinsw wrote:Out of interest what Bar Magnifier settings are you using in conjunction with this IOG backtest?


Hwllo wilkinsw,

My Bar magnifier settings are

BARMAGNIFIER.JPG
BARMAGNIFIER.JPG (55.91 KiB) Viewed 95 times


Setstoploss should be totally indipendent from the IOG settings (that however it is true) so I cannot explain it.


wilkinsw wrote:I suspect you've been stopped out at the next available data point (next bar open) which happens to be greater than your stop.

I would take a guess that your Bar magnifier setting isn't granular enough.


This is probably exactly what happen because OPEN price and STOPPED price are exactly the same.
Is there a way to fix this?
And also... I suppose that this can only happen in a backtest but NOT in real live trading (I hope!!!) because the stop orders are sent to the exchange as soon as the position are open.


thanks and Regard,

David

wilkinsw
Posts: 503
Joined: 21 Apr 2013
Has thanked: 129 times
Been thanked: 82 times

Re: setstoploss( stopPoints * bigpointvalue); with 20 points but I got stopped with 39 !!! How's possible??

Postby wilkinsw » 20 May 2019

I'm wondering if your tick dataset was missing the data to mark the stop as filled intrabar. Have you visualised and cross checked against you tick dataset?

Looking at all the fills it appears like there is a lack of tick data maybe.

I would expect live behaviour to have filled your stop as you'd expect: prior to the close with 20tick+slippage.


Return to “MultiCharts”