how to close trades at the end of the candle stick

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #206210 quote
    ACACAC
    Participant
    New

    hi,

     

    how do i write code that will close trades automatically at the end of the time period. for example if i am trading on a 5 minute period, it will close the trade at the end of the 5 minutes.

     

    thanks.

    #206219 quote
    robertogozzi
    Moderator
    Master

    Simply add SELL AT MARKET or/and EXITSHORT AT MARKET at the beginning of your code, as this will ensure your trades will be closed at the end of  the candle, when your strategy is run.

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

how to close trades at the end of the candle stick


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
ACACAC @acacac Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
3 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/22/2022
Status: Active
Attachments: No files
Logo Logo
Loading...