Sell at market when X%-profit

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #203146 quote
    SnorreDK
    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
    JS
    Participant
    Senior

    If LongOnMarket and Bear1 and Close > PositionPrice * 1.01 then
    Sell at (PositionPrice * 1.01) Stop
    EndIf

    #203151 quote
    SnorreDK
    Participant
    Junior

    Thanks JS, but does this mean I have to wait for the candleclose?

    #203152 quote
    JS
    Participant
    Senior

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

    #203194 quote
    SnorreDK
    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
    JS
    Participant
    Senior

    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.

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

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