1 trade only

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #152105 quote
    PaulchalPaulchal
    Participant
    Average

    Hi

    How do I write code that only permits 1 trade each day. For example the market opens (large volume) and my strategy meets its criteria and opens and closes a trade. I don’t want it to open another trade (even if my entry conditions are met) until tomorrow.

    Thanking you in advance

    #152120 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    Once TradeON = 1
    If IntraDayBarIndex = 0 Then
       TradeON = 1
    Endif
    If MyLongConditions and TradeON Then
       Buy at Market
       TradeON = 0
    Endif

    TradeON is a flag that does the trick.

    nonetheless and Bel thanked this post
Viewing 2 posts - 1 through 2 (of 2 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

1 trade only


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Paulchal @paulchal Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
5 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/29/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...