stop loss ad orario

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #155570 quote
    emanuele81emanuele81
    Participant
    Senior

    Scusate il disturbo, è possibile inserire uno stoploss ad orario? se per ipotesi alle 12 la strategia fosse in perdita di più di un 1% l’operazione si chiude, altrimenti continua ad andare

    #155578 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Si, eccolo:

    IF Time = 120000 THEN
       IF PositionPerf <= -0.01 THEN  //perdita dell'1% o maggiore
          SELL      AT MARKET
          EXITSHORT AT MARKET
       ENDIF
    ENDIF
    #155589 quote
    emanuele81emanuele81
    Participant
    Senior

    grazie mille, veramente molto gentile

    #155590 quote
    emanuele81emanuele81
    Participant
    Senior

    se volessi farla chiudere se è inferiore all’apertura della posizione?

    presumo che devo sostituire alla” -0.01″ una funzione, mi puoi dire quale?

    #155604 quote
    emanuele81emanuele81
    Participant
    Senior

    perfetto grazie

    #155605 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    La riga 2 deve essere una di queste:

    IF close < TradePrice THEN
    IF PositionPerf < 0 THEN
    #155616 quote
    emanuele81emanuele81
    Participant
    Senior

    per le operazioni long funziona in modo perfetto, per quelle schort invece no, le chiude comunque  alle 12, come posso risolvere

    #155618 quote
    emanuele81emanuele81
    Participant
    Senior

    grazie ho risolto anche per lo schort

    #155632 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Bene, in ogni caso alla primariga va messo > invece di <, mebntre la seconda rigava bene in entrambi i casi.

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

stop loss ad orario


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
emanuele81 @emanuele81 Participant
Summary

This topic contains 8 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
5 years, 9 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 12/29/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...