Close position if was negative

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #89388 quote
    HiraokiiHiraokii
    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
    robertogozzirobertogozzi
    Moderator
    Legend
    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
    HiraokiiHiraokii
    Participant
    Junior

    Thanks brother šŸ™‚

    #89518 quote
    HiraokiiHiraokii
    Participant
    Junior

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

    #89521 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
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

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 robertogozzirobertogozzi
7 years, 9 months ago.

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