Trading system

  • This topic has 1 reply, 2 voices, and was last updated 2 days ago by avatarJS.
Viewing 2 posts - 1 through 2 (of 2 total)
  • #249268

    Qualcuno può aiutarmi con questo codice? mi indica errore nella riga 30 e 31

    // Buffett-style Trading System con icone BUY/SELL
    // Timeframe: Daily

    // 1. Media a lungo termine
    sma150 = average[150](close)
    trendLong = close > sma150

    // 2. Prezzo vicino al minimo 50 giorni
    min50 = lowest[50](low)
    vicinoMinimo = close <= min50 * 1.10

    // 3. Volumi in aumento
    volOK = volume > average[20](volume)

    // 4. Forza relativa
    relativa = close / average[50](close)
    relativaInCrescita = relativa > relativa[5]

    // 5. RSI
    rsi14 = RSI[14]
    rsiOK = rsi14 > 40 AND rsi14 < 70

    // Condizione di ingresso
    buySignal = trendLong AND vicinoMinimo AND volOK AND relativaInCrescita AND rsiOK

    // Strategia
    IF buySignal AND NOT onmarket THEN
    BUY 1 SHARES AT market
    // Icona punto di entrata
    DRAWARROWUP(barindex, low – atr(14), “BUY”, RGB(0,150,0))
    ENDIF

    // Condizione di uscita: chiudi se RSI > 70 o prezzo < SMA150
    sellSignal = rsi14 > 70 OR close < sma150

    IF sellSignal AND onmarket THEN
    SELL AT market
    // Icona punto di uscita
    DRAWARROWDOWN(barindex, high + atr(14), “SELL”, RGB(200,0,0))
    ENDIF

    #249271
    JS

    Non è possibile utilizzare istruzioni “grafiche” in un sistema di trading (funzionano solo per gli indicatori…)


    Quello che si può utilizzare in un sistema di trading (a scopo di debugging):

    – Graph (visualizza le variabili in una finestra separata)
    – GraphOnPrice (visualizza le variabili sul grafico dei prezzi)
    – Print (visualizza le variabili in formato tabellare)


    Rimuovi le righe 30 e 39 e utilizza, ad esempio:
    GraphOnPrice Low – atr(14)
    GraphOnPrice High + atr(14)

    1 user thanked author for this post.
Viewing 2 posts - 1 through 2 (of 2 total)

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