Clearing pending orders

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #234681 quote
    MorpheousMorpheous
    Participant
    New

    I have a bug in my code where a position is getting closed and I cannot work out why, I’ve commented out all the places where the position is closed explicitly by the code and it makes no difference, so I assume it has something to do with a pending order.

     

    Is this the way to clear pending stop and target orders?

    set stop price 0
    set target price 0

    #234687 quote
    GraHalGraHal
    Participant
    Master

    Surely above code IS the reason your trades are getting closed?

    #234694 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Those instructions disable SL and TP, as there’s no need to disable pending orders because they expire every candle and you simply stop placing them if you don’t want them.

    GraHal, Iván González, inverse and Morpheous thanked this post
    #234765 quote
    MorpheousMorpheous
    Participant
    New

    I found the cause of my bug it was not related to the stop and target orders.

    robertogozzi thanked this post
Viewing 4 posts - 1 through 4 (of 4 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

Clearing pending orders


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Morpheous @morpheous Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/02/2024
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...