Does any Code Execute mid-Timeframe?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #10829 quote
    GraHal
    Participant
    Master

    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

    #10831 quote
    grizzly
    Participant
    Average

    Start coding on 1 minute timeframes.

    #10833 quote
    GraHal
    Participant
    Master

    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

    #10839 quote
    GraHal
    Participant
    Master

    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!

    #10840 quote
    grizzly
    Participant
    Average

    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

    #10881 quote
    GraHal
    Participant
    Master

    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 …

    1. Without Grexit (Grizzly Exit! ha) strategy
    2. With Grexit strategy.
    3. 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
    Without-Grizzle-Exit-Strategy.jpg Without-Grizzle-Exit-Strategy.jpg With-Grizzly-Exit-Strategy.jpg With-Grizzly-Exit-Strategy.jpg Results-with-Grizzly-Exit-Strategy.jpg Results-with-Grizzly-Exit-Strategy.jpg
    #10886 quote
    GraHal
    Participant
    Master

    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.

    Execution-10.10-on-3-hour-timeframe.jpg Execution-10.10-on-3-hour-timeframe.jpg
    #10889 quote
    GraHal
    Participant
    Master

    Had to add this separate as it was making the previous attachment the same as the attachment below … weird??

    Execution-10.10-on-3-hour-timeframe-but-shown-on-5-mins.jpg Execution-10.10-on-3-hour-timeframe-but-shown-on-5-mins.jpg
    #10892 quote
    GraHal
    Participant
    Master

    Time not showing (on my PC anyway) even though it is on the original jpeg.

    So here it is again

    Execution-10.10-on-3-hour-timeframe-but-shown-on-5-mins-1.jpg Execution-10.10-on-3-hour-timeframe-but-shown-on-5-mins-1.jpg
    #10901 quote
    Nicolas
    Keymaster
    Master

    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 🙂

    GraHal and Elsborgtrading thanked this post
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Does any Code Execute mid-Timeframe?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by Nicolas
9 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/23/2016
Status: Active
Attachments: No files
Logo Logo
Loading...