Single trade per day with stop orders

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #161293 quote
    OscJohOscJoh
    Participant
    Average

    Hello!

    All search results I’ve found only deal with how to limit your trades per day when using market orders. Currently, I’m using something like this:

    once EntriesToday = 0
    
    // Reset for each day
    if Date[1] <> Date[0] then
    EntriesToday = 0
    endif
    
    If OnMarket[0] <> 0 and OnMarket[1] = 0 then
    EntriesToday = EntriesToday + 1
    endif
    
    If not OnMarket and EntriesToday < 1 then
    Buy 1 contract at myLevel Stop // Stop order
    endif
    
    

    Here’s the problem. My systems always use stop orders to enter the market and sometimes a system is stopped out on the same bar it entered the trade, but EntriesToday can never be incremented with my current code. Thus it will attempt a second trade that I don’t want next bar again.

    I haven’t come up with a solution for this. Do any of you guys have suggestions to solve this? Or if there’s a setting for max executed orders per day in PRT I somehow missed

    Thanks

    #161303 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    To check if a trade has been both triggered and exited on the same bar you need to check STRATEGYPROFIT:

    If StrategyProfit <> StrategyProfit[1] then
       EntriesToday = EntriesToday + 1
    endif
    OscJoh thanked this post
    #161361 quote
    OscJohOscJoh
    Participant
    Average

    That worked, thanks a lot!

Viewing 3 posts - 1 through 3 (of 3 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

Single trade per day with stop orders


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
OscJoh @oscjoh Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by OscJohOscJoh
5 years, 8 months ago.

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