Break even also helps:
//Break even
startBreakeven = 50
PointsToKeep = 5
once breakeaven = 1//1 on - 0 off
//reset the breakevenLevel when no trade are on market
if breakeaven>0 then
IF NOT ONMARKET THEN
breakevenLevel=0
ENDIF
// --- BUY SIDE ---
//test if the price have moved favourably of "startBreakeven" points already
IF LONGONMARKET AND close-tradeprice(1)>=startBreakeven*pipsize THEN
//calculate the breakevenLevel
breakevenLevel = tradeprice(1)+PointsToKeep*pipsize
ENDIF
//place the new stop orders on market at breakevenLevel
IF breakevenLevel>0 THEN
SELL AT breakevenLevel STOP
ENDIF
// --- end of BUY SIDE ---
IF SHORTONMARKET AND tradeprice(1)-close>startBreakeven*pipsize THEN
//calculate the breakevenLevel
breakevenLevel = tradeprice(1)-PointsToKeep*pipsize
ENDIF
//place the new stop orders on market at breakevenLevel
IF breakevenLevel>0 THEN
EXITSHORT AT breakevenLevel STOP
ENDIF
endif
PaulParticipant
Master
Maybe it could add some benefit on the 1 sec too.
PaulParticipant
Master
1s update, lucky day so far
@Paul — your 1 second code is amazing, 2 good wins in the 20 minutes since I loaded it! I like how responsive it is, locks in any profit so quickly. Nice one!
All these Renkos are so hard working and they get out of losing positions so fast – blink and they change direction. I like that!
PaulParticipant
Master
@nonetheless Yeah me too! I’am losing faith a bit of systems working 10-20 years back, how about this! 🙂
Never tried anything on this timeframe and most likely it got lucky because of the dayrange.
But you see the difference between the backtest & demo? backtest long at 1642 and 1645, but not in the demo. I don’t understand it.
blink and they change direction. I like that!
Me too!
Since lately … blink on the DJi and if you are going in the wrong direction then you can be 100’s in loss!!!
backtest long at 1642 and 1645, but not in the demo.
Do you mean Backtest on Demo Account vs Forward Test / Live running on Demo Account?
the difference between the backtest & demo?
Yeah, that is a weird one. Maybe different engines? maybe slippage? or the way the Renko blocks are calculated … who knows.
PaulParticipant
Master
@GraHal, all in demo account. Loaded strategy on the chart compared to live running in demo. It’s not always in sync. Price-difference (spread/slippage) is oke, but big time-difference or not trading is not right.
big time-difference or not trading is not right.
I agree … doesn’t give us confidence.
We should try this and that to see if we can get Backtest (BT) synchronised nearer to Forward Test (FT).
We only have spread to adjust on the Platform, so we’d have to have several Systems on BT and FT at same time with 1, 2, 3, 4 … etc points in the code to simulate slippage??
We may be surprised at the results?
PaulParticipant
Master
here’s an update
Seems the trailing-stop I modified some time works good too (in the backtest)! Now you can set which one you want to use in top of the code.
I’ve tested the breakeven. But for now it doesn’t seem too add much because of the quick trailingstop & small stoploss.
Increased the nbbarlimit to 4 (minimum=1) It should make sure, if an order is not executed for any reason, like there was no data on that second, it’s repeated again. At least that’s the intention.
It could be that 1 second is not always long enough for the signal to travel from the PRT Server location to IG Server location?
Maybe 2 seconds may give better like for like comparison between BT and FT?
Do we even know if PRT Server is co-located with IG Server … or is one in France and one in London??
Are BT Servers in different locations and / or not as fast as FT Servers??
Just a few thoughts anyway.
PaulParticipant
Master
Interesting thoughts! I dunno. But if they offer 1 sec, it should be reliable regardless. I haven’t tried it on a different short timeframe. It’s something that needs testing.
PaulParticipant
Master
@GraHal it could be very well some kind lag then. Both systems should go onmarket at the same time but only one goes. I don’t have any rejections.
I just tried it v quickly – 10 sec, 5 sec, 2 sec all worse. 1 second is what works.
They are good fun Paul, thank you so much!
I am going to put 2 x v2p Systems on FT … they take so many trades that I am going to use 1 x v2p System for semi-manual trading … as in, I stop the System when I am away from the screen or if I think ‘I know better‘ than the System! Then I see how results stack up after 1 week.
Just an experiment … keep my hand in on manual trading! 🙂