Random trades?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #72095 quote
    tom
    Participant
    New

    Hi Team, recently started playing around with building a trade system, however run in some behaviour i can’t explain.

    I built a simple indicator:

    If 2 consecutive green bars, return 1, if 2 consecutive red bars, return -1

    Then I added a very simple trading system. Buy when the indicator returns 1, sell when indicator returns -1. It also draws a black arrow on the graph in these instances.

    I also configured simple SL and TP.

    When I run the system on dax against past data (21 ticks), i get seemingly weird behaviour. a buy or sell should occur at the start of the next bar according to my understanding, but this is not always the case. also some buy/sells seem to happen in middle of nowhere. Any thoughts what I’m missing?

    Screen-Shot-2018-06-03-at-08.47.32.png Screen-Shot-2018-06-03-at-08.47.32.png Screen-Shot-2018-06-03-at-08.50.03.png Screen-Shot-2018-06-03-at-08.50.03.png Screen-Shot-2018-06-03-at-08.50.16.png Screen-Shot-2018-06-03-at-08.50.16.png Screen-Shot-2018-06-03-at-08.50.43.png Screen-Shot-2018-06-03-at-08.50.43.png
    #72160 quote
    Nicolas
    Keymaster
    Master

    Do the problem exist on a time based timeframe? such as a 1 minute one for instance?

    Also, please share the indicator’s code to get a complete understanding. Thank you.

    #72162 quote
    tom
    Participant
    New

    Hi Nicolas,

    not sure for the 1 minute. Are you saying it’s because I’m at a ticks based timeframe? Is that supported by PRT?

    Please find hereby the code.

    currentopen = open
    currentclose = close
    
    currentrange = currentclose - currentopen
    
    currentRSI = RSI[14](close)
    
    IF (currentrange > 0 and subsequent >= 0) or (currentrange = 0 and subsequent > 0) THEN
    subsequent = subsequent + 1
    ELSIF (currentrange < 0 and subsequent <= 0) or (currentrange = 0 and subsequent < 0) THEN
    subsequent = subsequent - 1
    ELSE
    subsequent = 0
    ENDIF
    
    
    
    IF subsequent = 2 and (currentRSI-PreviousRSI >= 0) THEN
    output = 1
    DRAWARROWUP(barindex, open)
    ELSIF subsequent = -2 and (currentRSI-PreviousRSI <= 0)THEN
    output = -1
    DRAWARROWDOWN(barindex, close)
    ELSE
    output = 0
    ENDIF
    
    previousRSI = currentRSI
    
    return output
    

    Cheers

    Tom

    #72165 quote
    Nicolas
    Keymaster
    Master

    Non time-based chart are not compatible with real automatic trading (such as the ticks chart), but it works in backtests. I think that the differences you get between the indicator and the ticks chart are coming from the fact that the data history between ProBacktest and ProBuilder are not starting from the same exact tick, depending on how much bars are displayed on your price chart.

    21 ticks chart are automatically rebuild from 1 tick chart each time they are loaded.

    Test the strategy on a 1 or 5 minutes timeframe to see if the differences still occur.

    #72166 quote
    tom
    Participant
    New

    Mmm, ok, This was just a simple test. was looking to build something for scalping. 1 minute timeframes therefore would not be granular enough. Any plans to add tick based automated trading?

    Thanks for the quick reply.

    Cheers

    Tom

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Random trades?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
tom @tompijls Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by tom
7 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/03/2018
Status: Active
Attachments: 4 files
Logo Logo
Loading...