Uscita a metà posizione

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #223965 quote
    Mut1974Mut1974
    Participant
    New

    Buongiorno, io avrei bisogno di una strategia.
    Faccio un esempio con dei valori ipotetici per spiegarmi meglio:

    Entro long al valore 1000
    Stop loss al valore 950
    Take profit al valore 1100

    Quando il valore arriva a 1050 vorrei dimezzare la posizione e mettere lo stop loss a 1010

    Grazie

    #223987 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Eccolo:

    Entry = 1000
    SL    = 950
    SL2   = 1010
    TP    = 1100
    Half  = 1050
    Lotti = 2
    Meta  = max(1,round(Lotti / 2))
    IF Not OnMarket THEN
       IF close > Entry THEN
          BUY Lotti Contracts at Entry LIMIT
       ELSIF close < Entry THEN
          BUY Lotti Contracts at Entry STOP
       ENDIF
       SET STOP   PRICE SL
       SET TARGET PRICE TP
    ENDIF
    IF OnMarket AND (close >= Half) AND (abs(CountOfPosition) = Lotti) THEN
       SELL Meta Contracts at Market
       SET STOP   PRICE SL2
    ENDIF
Viewing 2 posts - 1 through 2 (of 2 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

Uscita a metà posizione


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Mut1974 @mut1974 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
2 years, 10 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 11/20/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...