Help with code for only one trade at a time

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14861 quote
    peterduk
    Participant
    New

    Hi, Is it possible to input a line of code so that a new trade does not execute if there is already a trade open on the instrument? I am finding in testing on shorter timeframe charts such as 1 minute or 2 minute if stops are set quite wide, trades are not lasting their full course due to new trades executing.  Any help would be appreciated. Many thanks.

    #14863 quote
    Stef
    Participant
    Average
    defparam cumulateorders=false

    or you can test if you have an open position with one of these

    if not onmarket and <rest of your conditions>
    or...
    if not shortonmarket and <rest of your conditions>
    or...
    if not longonmarket and <rest of your conditions>
    Nicolas and Bel thanked this post
    #14889 quote
    peterduk
    Participant
    New

    Thanks Stef, that’s a great help.

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

Help with code for only one trade at a time


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
peterduk @peterduk Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by peterduk
9 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 10/13/2016
Status: Active
Attachments: No files
Logo Logo
Loading...