MTF Sequential Setup

Viewing 4 posts - 46 through 49 (of 49 total)
  • Author
    Posts
  • #114115 quote
    jayvee
    Participant
    Average

    Festive greetings. I was hoping someone can help. I’m a bit stuck with multi timeframe analysis – have been testing out a few strategies. Sometimes the trade is executed as expected, sometimes not. Also when you backtest in some cases it states the entry and exit time is exactly the same and shows a profit or loss when technically it should be 0. I think this is true in a lot of cases actually – the ‘nbr bars’ shows many 0s yet in the ‘abs perf’ there are profits or losses – therefore the overall profit/loss figure is not right. I cant tell whether this is coding issue or an issue with multi timeframe?

    The code is below is an example using 10 hours and 10 mins as the default

    defparam cumulateorders=true
    
    timeframe(10 hour,updateonclose)
    myrsi1=rsi[10](close)
    
    timeframe(default)
    myrsi2=rsi[4](close)
    
    // BUY conditions
    Bullish0 = myrsi1>70 and myrsi2 crosses over 30
    
    IF Bullish0 THEN
    buy 2 perpoint AT MARKET
    set stop trailing 10
    
    ENDIF
    
    // SELL Conditions
    Bearish0 = myrsi1<30 and myrsi2 crosses under 70
    
    IF Bearish0 THEN
    SELLSHORT 2 perpoint AT MARKET
    set stop trailing 10
    
    ENDIF
    #114116 quote
    robertogozzi
    Moderator
    Master

    SET STOP TRAILING is known to be inaccurate, replacing it with a Trailing Stop code snippet is recommended.

    You can take a look at Nicolas’code https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/, you’ll find many examples on the forum. You can also find other snippets that mimick a trailing stop function.

    #114120 quote
    jayvee
    Participant
    Average

    Hello Roberto, hope all is well.

    Its the same issue without the trailing stop loss. Cant understand why in a lot of cases when backtesting it says nbr bars = 0 (entry time and exit time is the same) – yet it shows profit or loss.

    Also why some trades do not happen even thought they meet the criteria; shows up in the backtest but not in actual trades.

    Not had these issues when using standard timeframe (i.e. without multi timeframes)

    #114132 quote
    robertogozzi
    Moderator
    Master

    The same bars is because it opens a trade, then the trailing stop (starting from 10 and a predefined step of 1), due a pullback within the same bar, exits the trade with either a profit or a loss.

    It is very likely that in a 10-minute bar the price moves more than 10 pips; it also may occur that there’s an immediate pullback.

    Be warned that if you enter more positions, despite being at different prices, ALL positions are exited at the same STOP level. ProOrder doesn’t keep separate SL’s for each position opened!

    jayvee thanked this post
Viewing 4 posts - 46 through 49 (of 49 total)
  • You must be logged in to reply to this topic.

MTF Sequential Setup


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
PhilippeN @philippen Participant
Summary

This topic contains 48 replies,
has 8 voices, and was last updated by robertogozzi
6 years, 2 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/10/2019
Status: Active
Attachments: 7 files
Logo Logo
Loading...