Happy new year everybody.
I have the issue - Setstoploss do not work. Please look at screenshot. I have really small stop - Setstoploss(10);
Upper screen is 1 day chart, lower screen is 1 hour chart. On 1 hour chart clearly can see that stop have to be worked, because 10$ stop is 0,01$ price movement. In my case enter was on price level 52.62$ and the lowest point after entering was 52.29$
Why Setstoploss not working correctly?
Setstoploss do not work correct
- lingwuchung
- Posts: 50
- Joined: 03 Feb 2014
- Has thanked: 6 times
- lingwuchung
- Posts: 50
- Joined: 03 Feb 2014
- Has thanked: 6 times
Re: Setstoploss do not work correct
Then I am not sure if you are having the same issue as me: viewtopic.php?t=52924This is backtestIs this real/paper trade or backtesting?
Try to call the setstoploss(10) at EVERY BAR (unconditionally, say at top of the main iteration) and see if that makes a difference.
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: Setstoploss do not work correct
I think the shortest time frame (1hour) needs to be data1 and daily on Data2.
- Vlada MultiCharts
- Posts: 293
- Joined: 22 Apr 2020
- Has thanked: 8 times
- Been thanked: 76 times
Re: Setstoploss do not work correct
Hello,
On our end the issue you described is not reproduced.
Please revise your signal code and temporarily comment out other exits.
Also you can try to apply this code on a new chart:
On our end the issue you described is not reproduced.
Please revise your signal code and temporarily comment out other exits.
Also you can try to apply this code on a new chart:
Code: Select all
buy next bar 52.62 limit;
setstopcontract;
setstoploss(10);
Re: Setstoploss do not work correct
Well, I think this one issue is still not fully addressed:On our end the issue you described is not reproduced.
Please revise your signal code and temporarily comment out other exits.
Also you can try to apply this code on a new chart:Code: Select all
buy next bar 52.62 limit; setstopcontract; setstoploss(10);
1) Can SetStopLoss (and the other built-in exits) be set CONDITIONALLY.
ex:
Code: Select all
If OpenPositionProfit > 1000 Then
SetStopLoss(100)
Else if OpenPositionProfit < 500
SetStopLoss(50);
Am I right ?
- Vlada MultiCharts
- Posts: 293
- Joined: 22 Apr 2020
- Has thanked: 8 times
- Been thanked: 76 times
Re: Setstoploss do not work correct
syswizard,
Yes, your understanding is correct.
With Intra Bar Order Generation disabled, the new parameters of the orders are applied on the bar close.
Yes, your understanding is correct.
With Intra Bar Order Generation disabled, the new parameters of the orders are applied on the bar close.