contatore STOP LOSS e INVERSIONE

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33230 quote
    Rocco D’Auria
    Participant
    New

    Salve, nella mia strategia inverto la posizione solo se c’è stato uno stop loss e non una chiusura per un ordine stop o limite ma non riesco a codificare.

    Mi chiedevo se qualcuno potesse indicarmi come fare per capire se ho chiuso una posizione a causa di uno stop loss oppure per un’uscita.

    Mi spiego meglio.

    Se il mio ordine era

    — sell at x stop

    oppure

    —exitshort at x stop

    devo fare una cosa,

    se invece ho chiuso la posizione perchè è intervenuto uno stop loss

    – set stop ploss … o sloss o altro

    devo fare un altra cosa.

    C’è un comando o un modo per capire o mettere in una variabile “la causa” dell’uscita dalla posizione precedente?

    #33317 quote
    Nicolas
    Keymaster
    Master

    Un’idea rara sarebbe quella di utilizzare POSITIONPERF e di calcolare se corrisponde al tuo stoploss in denaro? Se la risposta è sì, il tuo ordine è chiuso a causa di un stoploss.

    #33427 quote
    gabri
    Participant
    Master

    Rocco,

    magari questo codice puo’ servire

     

    sl=xxx
    sellstop=yyy
    
    if not longonmarket and not shortonmarket then
    lastexitprice=tradeprice
    endif
    if lastexitprice=sl then
    slout=1
    stopout=0
    else
    slout=0
    stoput=1
    endif
    
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

contatore STOP LOSS e INVERSIONE


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 04/24/2017
Status: Active
Attachments: No files
Logo Logo
Loading...