Sell at market when X%-profit

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #203146 quote
    SnorreDKSnorreDK
    Participant
    Junior
    Is this possible within a candle. Dont wait untill candleclose
    if X% in profit and Bear1 then
    sell at market
    Endif
    This code is not what i need, though it waitns untill candleclose:
    if longonmarket and bear1 and (close > positionprice * 1.01) then
    SELL AT MARKET
    endif
    #203150 quote
    JSJS
    Participant
    Master
    If LongOnMarket and Bear1 and Close > PositionPrice * 1.01 then Sell at (PositionPrice * 1.01) Stop EndIf
    #203151 quote
    SnorreDKSnorreDK
    Participant
    Junior
    Thanks JS, but does this mean I have to wait for the candleclose?
    #203152 quote
    JSJS
    Participant
    Master

    No, you don’t have to wait because it’s a STOP order…

    #203194 quote
    SnorreDKSnorreDK
    Participant
    Junior
    If I do understand You correct then A=1 and A=2 would give the same result but it does not.
    if A=1 then
    posProfit = (((close - positionprice) * pointvalue) * countofposition) / pipsize
    IF LONGONMARKET AND (posProfit > 0) and Bear1 THEN
    SELL AT MARKET
    ENDIF
    endif
    if A=2 then
    IF LONGONMARKET AND Bear1 THEN
    SELL at (positionprice*1) stop
    ENDIF
    endif
    #203195 quote
    JSJS
    Participant
    Master

    Hi @SnorreDK

    You can’t compare them because a “Market” order always gives a different result than a “Stop” order…

    If A=2 then

    IF LONGONMARKET AND Bear1 and Close > (PostionPrice * 1.01) THEN

    SELL at (PositionPrice * 1.01) stop

    EndIf

    EndIf
Viewing 6 posts - 1 through 6 (of 6 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

Sell at market when X%-profit


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
SnorreDK @snorredk Participant
Summary

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

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