non mi inserisce gli stop loss e i profit

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #201523 quote
    Mauro MMauro M
    Participant
    New

    quando il sistema entra in funzione non mi ritrovo gli stop inseriti nel backtest funziona benissimo.
    NTICK = xxxx
    N2TICK =xxxx
    X1 =xxxxxxx
    X2 =xxxxxxx

    c4=barindex-tradeindex=4
    //Long entry
    if Close < xxxxxxx <= X1 andxxxxxxxxx) >= X2 then
    buy 1 shares at xxxxx + xxxxxxx stop
    endif

    //stop loss massimo in punti dal prezzo ingresso
    if LongOnMarket and c4 then
    SELL AT MARKET
    set stop ploss 85
    set target profit 500
    endif
    //Short entry
    if Close > xxxxxxxxxxxx <= X1 xxxxxxxxxxx>= xxxxxxx then
    sellshort 1 shares at xxxxxxxxxx – xxxxxxxxxxx stop
    endif

    //stop loss massimo in punti dal prezzo ingresso
    If ShortOnMarket AND c4 THEN
    EXITSHORT AT MARKET
    set stop ploss 85
    set target pprofit 500
    endif

    #201542 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Due cose:

    • sotto a SELL manca una p in set target pprofit 500
    • metti stop loss e target quando esci dal mercato e non quando entri!?
    #201567 quote
    Mauro MMauro M
    Participant
    New

    Roberto ….mi interessa mettere gli stop loss e lo stop proffit …appena entro a mercato. Perché nel testing è perfetto?

    Roberto riesci a correggere i miei errori

    #201573 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Basta spostare le righe dove ci sono SET STOP e SET TARGET dall’IF delle uscite a quello delle entrate, anzi, meglio rimuovere quelle 4 linee e aggiungerle alla fine (o all’inizio, è indifferente):

    NTICK = xxxx
    N2TICK =xxxx
    X1 =xxxxxxx
    X2 =xxxxxxx
    
    c4=barindex-tradeindex=4
    //Long entry
    if Close < xxxxxxx <= X1 andxxxxxxxxx) >= X2 then
       buy 1 shares at xxxxx + xxxxxxx stop
    endif
    
    //stop loss massimo in punti dal prezzo ingresso
    if LongOnMarket and c4 then
       SELL AT MARKET
    endif
    //Short entry
    if Close > xxxxxxxxxxxx <= X1 xxxxxxxxxxx>= xxxxxxx then
       sellshort 1 shares at xxxxxxxxxx – xxxxxxxxxxx stop
    endif
    
    //stop loss massimo in punti dal prezzo ingresso
    If ShortOnMarket AND c4 THEN
       EXITSHORT AT MARKET
    endif
    set stop   ploss   85
    set target pprofit 500
Viewing 4 posts - 1 through 4 (of 4 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

non mi inserisce gli stop loss e i profit


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Mauro M @mauro-m Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
3 years, 11 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 09/27/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...