Help Setting Minimum Number of Bars Between Trades

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24095 quote
    Benjamin
    Participant
    New

    Hi, I am looking for some help generating a section of code to help smooth out one of the trading strategies I am working on. Thanks to the useful pdf created in the help section I have managed to work through most of my issues, however I do not seem to be able to get my head around something which should be extremely simple. I am looking to implement a gap between trades and I assumed that the easiest way to do this would be to set a minimum number of bars between the last executed trade and the next one triggered by the strategy. Basically, once my trading indicators are met I enter the market and exit very quickly, however I do not then want to enter the market again if those conditions continue to be met for the next ‘x’ amount of bars. Could anybody help me understand how I stop the strategy re-entering the market for ‘x’ amount of bars.

    E.g. If I were to open a long position when the RSI crossed over 70 with a very short target profit of 3 pips the trading strategy would after exiting a profitable trade continue re-entering the market each time the RSI re-crossed over 70. If we were working on a 1 minute chart the RSI may dip below and re-cross the 70 mark a number of times for the next 30 minutes. In the above circumstance I would be looking to avoid re-entering the market after the initial trade had been entered and exited during that 30 minute window.

    Any help would be much appreciated.

    Thanks, Ben.

    #24111 quote
    Benjamin
    Participant
    New

    Penny has finally dropped, explanation no longer needed.

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

Help Setting Minimum Number of Bars Between Trades


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Benjamin @benjamin Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by Benjamin
9 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/06/2017
Status: Active
Attachments: No files
Logo Logo
Loading...