limit one trade per candle

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #163399 quote
    kevin12345kevin12345
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    kevin12345kevin12345
    Participant
    Average

    should the tradeon in line 10 be equal to something ?

    #163413 quote
    NicolasNicolas
    Keymaster
    Legend

    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 NicolasNicolas
5 years, 6 months ago.

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