TRADING SYSTEM CON SUPERTREND E PARABOLIC SAR

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

    Buongiorno

    vorrei creare un trading system in cui vengono combinati gli indicatori supertrend e parabolic sar, quella con il supertrend l’ho già sviluppata questo è il codice.

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
    // Condizioni per entrare su posizioni long
    indicator1 = SuperTrend[2.6,1]
    c1 = (close CROSSES OVER indicator1[1])

    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF

    // Condizioni per uscire da posizioni long
    indicator2 = SuperTrend[2.6,1]
    c2 = (close CROSSES UNDER indicator2)

    IF c2 THEN
    SELL AT MARKET
    ENDIF

    // Condizioni per entrare su posizioni short
    indicator3 = SuperTrend[1,12]
    c3 = (close CROSSES UNDER indicator3)

    IF c3 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF

    // Condizioni per uscire da posizioni short
    indicator4 = SuperTrend[1,12]
    c4 = (close CROSSES OVER indicator4)

    IF c4 THEN
    EXITSHORT AT MARKET
    ENDIF

    // Stop e target
    SET STOP pLOSS 241
    SET TARGET pPROFIT 136

    A questo codice vorrei aggiungere la condizione che per entrare in posizione  oltre al supertrend anche il parabolic sar sia long a short

    qualcuno mi può aiutare?

    Grazie anticipatamente per la collaborazione.

    #213372 quote
    KAMJKAZEKAMJKAZE
    Participant
    Junior

    È sufficiente che aggiungi :

    close> sar per le posizioni long

    close < sar per lo short

    Ora sto scrivendo dal telefono quindi non so dirti se la dicitura SAR è corretta ma puoi utiliazzarre l’autocompilazione mentre scrivi il codice,  utilizzando il tasto lampadina in alto sulla schermata di scrittura.
    In  generale è una funzione di auto compilazione molto utile per scrivere correttamente il codice

Viewing 2 posts - 1 through 2 (of 2 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

TRADING SYSTEM CON SUPERTREND E PARABOLIC SAR


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
PICCI64 @picci64 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by KAMJKAZEKAMJKAZE
3 years, 5 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 04/16/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...