Entry days for Weekly trading system

Forums ProRealTime English forum ProOrder support Entry days for Weekly trading system

Viewing 3 posts - 1 through 3 (of 3 total)
  • #44180
    #44185

    Can you post an example?

    #44193

    Good morning, I would like to program an Ts in this way:

    Enter long if the price is higher than the last candle last week

    Enter short if the price is below the minimum candle last week

    I have programmed it as code below but it does not work, can anyone tell me why and how to fix it? Thanks so much

     

     

     

     

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate

    // Impedisce al sistema di tradare in giorni specifici della settimana
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0

    // Condizioni per entrare su posizioni long
    c1 = (close > DHigh(1)[1])

    IF c1 AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    // Condizioni per entrare su posizioni short
    c2 = (close < DLow(1)[1])

    IF c2 AND not daysForbiddenEntry THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF

    // Stop e target
    SET STOP $TRAILING 160

Viewing 3 posts - 1 through 3 (of 3 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login