Gestione strategia multi trigger

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

    Salve,

    sono nuovo nel forum, e questa è la mia prima richiesta di supporto.

    Vorrei sapere se in PRT è possibile creare una strategia automatica con ad esempio 8 trigger di entrata, e scegliere tramite ottimizzazione la condizione migliore.

    Se ad esempio:

    Trigger 1: range of today > 0.75% of low of today
    Trigger 2: range of today < 0.75% of low of today
    Trigger 3: yesterday closed below the open
    Trigger 4: yesterday closed above the open
    Trigger 5: price declined > 0.5% yesterday
    Trigger 6: price advanced > 0.5% yesterday
    Trigger 7: yesterday high was above 5-day-ago high
    Trigger 8: yesterday low was below 5-day-ago low

    If Trigger X then buy 1 contract at market

    E’ possibile backtestare gli 8 trigger contemporanemanete, per scegliere la condizione più favorevole? Se si, come? Se devo usare un Array, come deve essere impostata la funzione?

    Grazie

    #217786 quote
    robertogozzi
    Moderator
    Master

    Eccolo (usa la variabile X per l’ottimizzazione, nel file allegato è già predisposta):

    /*
    Trigger 1: range of today > 0.75% of low of today
    Trigger 2: range of today < 0.75% of low of today
    Trigger 3: yesterday closed below the open
    Trigger 4: yesterday closed above the open
    Trigger 5: price declined > 0.5% yesterday
    Trigger 6: price advanced > 0.5% yesterday
    Trigger 7: yesterday high was above 5-day-ago high
    Trigger 8: yesterday low was below 5-day-ago low
    */
    DEFPARAM CumulateOrders = False
    $Trigger[1] = range > (low * 0.0075)                  //riporto la condizione cha hai scritto, anche se non ne
    //                                                      comprendo la logica. Confronti un prezzso con un intervallo
    //                                                      di prezzi (range)
    $Trigger[2] = range < (low * 0.0075)                  // idem
    $Trigger[3] = close[1] < open[1]
    $Trigger[4] = close[1] > open[1]
    $Trigger[5] = close[1] < open[1] * 0.995
    $Trigger[6] = close[1] > open[1] * 1.005
    $Trigger[7] = high[1] > high[5]
    $Trigger[8] = low[1]  < low[5]
    IF $Trigger[x] THEN
       BUY AT MARKET
    ENDIF
    SET TARGET pPROFIT 400
    SET STOP   pLOSS   200

    Per favore pubblica solo nella lingua del forum in cui stai postando. Ad esempio solo l’inglese nei forum di lingua inglese e il francese solo nei forum di lingua francese.  L’ho spostato io dal forum Francese. Grazie 🙂

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

Gestione strategia multi trigger


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Cla @cla Participant
Summary

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

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