strtegia trovata nel forum

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #214278 quote
    Ciccarelli Franco
    Participant
    Junior

    Sto provando una strategia trovata nel forum (allegato) e vorrei se possibile avere la versione short.

    Grazie

    #214283 quote
    MauroPro
    Participant
    Veteran

    Non è indicato né  lo strumento dove applicare il TS, né il timeframe, inoltre ci sono due variabili non utilizzate. Le uniche valideda inserire sono:  TP [20;70 step 10]  e TRA [5:30 step 5].

    Prova questo:

    babyL=high>high[1] and low>low[1] //pattern per l’ingresso
    entrataL= high[1] + 1*POINTSIZE //livello di entrata: il MAX della candela [1]
    uscitaL=barindex-tradeindex>=10 //uscita a tempo: dopo 10 candele

    babyS=low<low[1] and high<high[1] //pattern per l’ingresso
    entrataS= low[1] – 1*POINTSIZE //livello di entrata: il MAX della candela [1]
    uscitaS=barindex-tradeindex>=10 //uscita a tempo: dopo 10 candele
    //———————————————————————————————–
    IF babyL and entrataL THEN //condizione verificata per buy
    BUY 1 CONTRACTS AT entrataL stop //compra a qualsiasi prezzo sopra il livello di entrata
    SET STOP LOSS (high[1]-lowest[2](low))+4*pointsize //stoploss: il il MAX candela[1] – il minimo del pattern + 4 punti
    endif
    If OnMarket and uscitaL THEN //condizione verificata per uscire a tempo
    SELL AT MARKET //vende a qualsiasi prezzo
    ENDIF
    //———————————–
    IF babyS and entrataS THEN //condizione verificata per vendere
    sellShort 1 CONTRACTS AT entrataS stop //vendi a qualsiasi prezzo sotto il livello di entrata
    SET STOP LOSS abs(low[1]+highest[2](high))+4*pointsize //stoploss: il il MIN candela[1] – il massimo del pattern + 4 punti
    endif
    If OnMarket and uscitaS THEN //condizione verificata per uscire a tempo
    exitShort AT MARKET //vende a qualsiasi prezzo
    ENDIF
    //———————————–
    SET TARGET PPROFIT tp
    //————————————————————————
    //trailing stop
    trailingstop = TRA
    //resetting variables when no trades are on market
    if not onmarket then
    MAXPRICE = 0
    MINPRICE = close
    priceexit = 0
    endif
    //case LONG order
    if longonmarket then
    MAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current trade
    if MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
    priceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE – trailing stop price level
    endif
    endif
    //case SHORT order
    if shortonmarket then
    MINPRICE = MIN(MINPRICE,close) //saving the MFE of the current trade
    if tradeprice(1)-MINPRICE>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
    priceexit = MINPRICE+trailingstop*pointsize //set the exit price at the MFE + trailing stop price level
    endif
    endif
    //exit on trailing stop price levels
    if onmarket and priceexit>0 then
    SELL AT priceexit STOP
    EXITSHORT AT priceexit STOP
    endif
    //————————————————————————————–

    #214286 quote
    Ciccarelli Franco
    Participant
    Junior

    Le variabili , che poi ho tolto, servivano per l’uscita a tempo e lo stop loss, sinceramente non ho idea se servano.

    Grazie

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

strtegia trovata nel forum


ProOrder: Trading Automatico & Backtesting

New Reply
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Ciccarelli Franco
2 years, 9 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 05/08/2023
Status: Active
Attachments: 1 files
Logo Logo
Loading...