I am getting ‘sick to death’ of waiting for the ‘PRT Techie Elves’ to sort the issue re ‘Stops and Targets producing Utopian Equity Curves on Backtest’ etc.
In BACKTEST is there any code that executes mid-Timeframe to get us out of a trade at a predetermined Target Profit or Stop Level?
I am thinking here of Buy/ Sell at Price Limits and Price Stops?
On Backtest … surely a ‘Sell Stop’ at X Price doesnt wait until the end of 4 hour bar to ask … during that 4 hours did the price reach X Price? Yes … close the trade at X Price (even though by the end of the 4 hour bar the Price may have gone back up / down again and the trade is now back in Profit!).
Even reading above it sounds ludicrous, but that is what happens re ‘Points Stop Loss’ and ‘Points Profit Target’.
We need a rebellion / a signed petition to shake those PRT Elves into telling us when the ‘0 Bars’ issue will be sorted?
We are the Customers / Users / Clients and what is happening now (no target date re major platform issues) is not good Customer Service!?
Hope above makes sense, if not just say?
GraHal
Start coding on 1 minute timeframes.
Thanks Grizzly, not a 100% solution though … the same illogic happens re the ‘o bars showing profit’ happens, but I agree 1 minute timeframe does compensate to some extent.
The point is though there is enough ‘natural’ differences between Backtest and Demo / Live without this ‘unnatural / illogic PRT o bars issue’ making life more difficult and our profits less!
Cheers
GraHal
Also I feel like I am wasting my time and not getting optimum results … like sawing a piece of wood with a saw that you know needs sharpening!
Hi Grahal – could you share an example of where you are finding differences between backtest and live ?
I personally have found this to be the case. HOWEVER, i quickly realise its because of:
- Live Spreads fluctuate. Backtested spreads do not.
- Code is almost always Time Frame SPECIFIC. HFTs are called HFTs for a reason. Value Investors are called Value investors for a reason. I would believe the PRT community is somewhere in between.
- Code is too focused on entry and execution rather than riding the larger trend.
- Finally, everyone here complains of ‘0 bars’. This matter can EASILY be circumvented by inserting “RULE 1 = (Barindex-tradeindex)>=1” into all entry and exit conditions.
Cheers
Grizzly
Hi Grizzly, thanks again, I tried it but I still got loads of ‘0 bars’ … by which I mean as shown below.
At the risk of saying / showing something daft, I’ll keep on this one until I am clear in my head.
Attachments are Results …
- Without Grexit (Grizzly Exit! ha) strategy
- With Grexit strategy.
- Equity Curve with Grexit Strategy
And here’s the c0de
PS I’m begining to think I should have given this Topic a different title?
defparam cumulateorders=false
defparam preloadbars=2000
defparam flatbefore=090000
defparam flatafter=213000
Rule1 = (Barindex-tradeindex)>=1
mycompra, myventa = CALL "ALEX ATB Indicator"
ema=ExponentialAverage[8](close)
advance=abs(round(ema-ema[1]))
mylot=min(1000,(((Strategyprofit+3000)*0.02)/30))
if not longonmarket and mycompra=1 and Rule1 then
BuyPrice = ema+advance
buy mylot contract at BuyPrice limit
endif
if not shortonmarket and myventa=-1 and Rule1 then
SellPrice = ema-advance
sellshort mylot contract at sellprice limit
endif
If Rule1 then
set stop ploss 30
set target pprofit 25
endif
Re above … running on a 3 hour timeframe (03:00, 06:00, 09:00 bars etc) … why did a trade execute at 10.10 this morning??
See attachment for time and also the same trade but on a 5 minute timeframe to show the trade time and price movement since 9 oclock.
Had to add this separate as it was making the previous attachment the same as the attachment below … weird??
Time not showing (on my PC anyway) even though it is on the original jpeg.
So here it is again
Hey folks, i’m on leave actually, but I saw your first post GraHal 🙂
I can tell you that the ‘PRT Techie Elves’ are working hard. It’s almost done.. “almost” because not released yet to public.. Believe me that this feature with other nice ones will come sooner than expected. This is all I can say (and know), so don’t ask “when” please 🙂