Placing Limit Sell Order

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #188384 quote
    Mishap
    Participant
    Junior

    Hi Guys,

    I m trying a strategy where i place a buy stop or sell limit order based on certain criteria. The issue i am finding is that the order gets cancelled on the next bar & does not stay open so the order never fills & then the strategy stops.

    Can anyone point me in the right direction as to what i should be doing to keep an order open. I have placed an example of some of the entry requirements for a sell and buy with regards to price to buy/sell below.

    hoping someone can shed some light on the issue, thanks in advance.

    if low crosses under EMA1 then
    BUYentry = high
    signal = 1
    endif
    
    if low crosses over EMA1 then
    SELLentry = low
    signal = 1
    endif
    
    IF not onmarket and xx AND xx  and xx and xx THEN
    BUY 2 Contracts at BUYentry stop
    SET TARGET pPROFIT ---
    SET STOP pLOSS ---
    ENDIF
    
    IF not onmarket and x AND x  and x and x THEN
    sellshort 2 Contracts at SELLentry limit
    SET TARGET pPROFIT ---
    SET STOP pLOSS --
    ENDIF
    
    #188386 quote
    GraHal
    Participant
    Master

    Does it work as you want if you remove Not onmarket?

    #188387 quote
    robertogozzi
    Moderator
    Master

    Pending orders always LAST one bar.

    They must be placed again, each bar, till needed.

    Removing Not onmarket as suggested by GraHal should do.

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

Placing Limit Sell Order


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Mishap @mishap Participant
Summary

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

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