Close position if was negative

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #89388 quote
    Hiraokii
    Participant
    Junior

    hi guys, I need help again.

    i was thinking if is possible to close the order if the order became negative.

    #89403 quote
    robertogozzi
    Moderator
    Master
    IF LongOnMarket THEN
       IF close < Tradeprice THEN
          SELL AT MARKET
       ENDIF
    ELSIF ShortOnMarket THEN
       IF close > TradePrice THEN
          EXITSHORT AT MARKET
       ENDIF
    ENDIF

    I did not test it, though.

    #89414 quote
    Hiraokii
    Participant
    Junior

    Thanks brother 🙂

    #89518 quote
    Hiraokii
    Participant
    Junior

    I don’t know why, but it’s not working.

    #89521 quote
    robertogozzi
    Moderator
    Master

    Please post the whole code to be able to test it.

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

Close position if was negative


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Hiraokii @hiraokii Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/23/2019
Status: Active
Attachments: No files
Logo Logo
Loading...