Time based opening or closing of a trade

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

     

    Hi Happy Coders,

    Is there a way we can open or close a trade on a time basis,

    Thanks

    #197477 quote
    JS
    Participant
    Senior
    Hi @UkDownUnder

    Yes, you can…

    To open a time related position:

    IF Time >= 090000 AND Not OnMarket THEN

    Buy positionsize contract at market

    EndIf

    IF Time = 100000 THEN

     TradeOK = 1

    To close a time related position:

    if shortonmarket and time = 230000 THEN

    EXITSHORT positionsize CONTRACT AT MARKET

    ENDIF

    if longonmarket and time = 000000 THEN

    SELL positionsize CONTRACT AT MARKET

    ENDIF

    (Time ranges from 000000 to 235959)

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

Time based opening or closing of a trade


Platform Support: Charts, Data & Broker Setup

New Reply
Author
author-avatar
UkDownUnder @jamescoop Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JS
3 years, 7 months ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 07/19/2022
Status: Active
Attachments: No files
Logo Logo
Loading...