how to close trades at the end of the candle stick

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #206210 quote
    ACACACACACAC
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
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

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 robertogozzirobertogozzi
3 years, 9 months ago.

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