limit one trade per candle

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #163399 quote
    kevin12345
    Participant
    Average

    how do i limit one trade per candle because i have a trade that was open in a lower timeframe and it close for exit reasons. after exit, it opens another position within the same candle on the higher time frame.

     

    thank you

    #163403 quote
    robertogozzi
    Moderator
    Master

    There you go:

    Timeframe(1h,UpdateOnClose)
    Bar1H = barindex
    //
    Timeframe(default)
    Once TradeON = 1
    MyBar = Bar1H
    If MyBar <> MyBar[1] Then
       TradeON = 1
    Endif
    If MyLongConditions and TradeON Then
       Buy 1 contract at Market
       TradeON = 0
    Endif
    #163406 quote
    kevin12345
    Participant
    Average

    should the tradeon in line 10 be equal to something ?

    #163413 quote
    Nicolas
    Keymaster
    Master

    It’s a boolean which will be equal to 1 (true) when the barindex from the 1 hour timeframe is different from the previous one on the inferior timeframe.

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

limit one trade per candle


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
kevin12345 @kevin12345 Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/08/2021
Status: Active
Attachments: No files
Logo Logo
Loading...