Big difference with pLOSS on/off even though its never been touched
Forums › ProRealTime English forum › ProOrder support › Big difference with pLOSS on/off even though its never been touched
- This topic has 12 replies, 3 voices, and was last updated 3 years ago by Trond Steinar Haugen.
-
-
07/12/2020 at 11:32 AM #139062
Hello
I’ve made an algo before i knew that the “SET STOP pLOSS xx pTRAILING” did’nt work.
I used the optimizer to find best combo of the two. It found that the best combo was pLOSS 27 and pTRAILING was 2. Which I thougt was weird. In the backtest the “loss of worst trade” is 2£ which I thougt would indicate that the pLOSS never was touched. However, if I remove the pLOSS function. The backtest results dramatically changes.
Can anyone explain why?
And I’ve read in here before that the pTRAILING function should not be used because it does not take in to account the trailing step factor.
But the instrument I’ve been using this bot on has 1 step trailing. And I’ve read somewhere on this forum that the pTRAILING uses 1step trailing. Will the back test be reliable then?
07/12/2020 at 11:50 AM #13906707/12/2020 at 12:07 PM #139070Yes the tick by tick mode is on.
07/12/2020 at 12:08 PM #139071SET STOP pLOSS xx pTRAILING cannot be used, because two different kind of stops are not allowed.
Use either SET STOP pLOSS or SET STOP xx pTRAILING.
If you use both on separate lines, only the last one will be used.
07/12/2020 at 12:47 PM #139077Yes I know now, but I made the algo before I knew.
The problem is when i only use the pTRAILING function(remove the pLOSS), the performence dramatically changes. Even though I seems that the pLOSS part of the function never was touched.
I had the pLOSS on 27 and the pTRAILING on 2, and the “worst trade” was only 2£. Does’nt that mean that only the pTRAILING was executed?
07/12/2020 at 1:25 PM #139080I suggest that you use some trailing stop code instead of the native one.
07/12/2020 at 3:55 PM #139088I think I’ve tried every hardcoded trailing stops on this forum, but i’m afraid they don’t work. This is because most of my trailing stops happens within a candle.
What I don’t understand is why would there be a difference without pLOSS? When the pLOSS is 25 points away.. Is there a bug with the probacktest?
07/15/2020 at 9:19 AM #139074SET STOP pLOSS xx pTRAILING cannot be used, because two different kind of stops are not allowed.
Use either SET STOP pLOSS or SET STOP xx pTRAILING.
If you use both on separate lines, only the last one will be used.
Yes, as I said in the post, I made this algo before I was aware that this function did’nt work.
But when I remove the pLOSS part of the function and only use the pTRAILING, the change is so dramatic even though the pLOSS does’nt seem to be touched in the first algo.07/15/2020 at 9:25 AM #13931107/15/2020 at 9:42 AM #139317Thats a really good idea GraHal.
How do you code that?
I tried “GRAPH Set Stop pLoss”. Does’nt seem to work.
07/15/2020 at 9:53 AM #139318I tried “GRAPH Set Stop pLoss”. Does’nt seem to work.
Mmm try something like below (for a long) …
Not tested
12345If longonmarket ThenMyStop = TradePrice - p*pipsize (p = p value in pLoss entry)EndifGRAPH MyStopYou should get ‘1’ if / when condition / MyStop is true.
07/15/2020 at 11:01 AM #139322I did’nt manage do get it to work. The GRAPH showed no results, and it did not show any result even if i set the Loss value to less than the trailing stop.
However, I tried making my own “SET STOP pLOSS” function.
hardcode pLOSS function12345678910//Hjemmelagd StoplossIF StoplossHjemmelagdSell = 1 THENmySL = tradeprice(1)+StoplossS*pipsizeIF NOT ONMARKET THENmySL=0ENDIFIF mySL>0 THENEXITSHORT AT mySL STOPENDIFENDIFI’m having the same huge difference in performance.
And there is no difference if i turn it on/off.
So im thinking that there must be some kind of a bug i the backtesting software?
-
AuthorPosts