1 trade only

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #152105 quote
    Paulchal
    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
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
5 years, 2 months ago.

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