Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Indicatore Range Threshold Prev Session //
- // Vedi Anche Versione Study Range Threshold Prev Session //
- // ===============================================================
- // Indicatore Range Threshold Prev Session
- // Versione Unificata con Input LONG e SHORT Separati
- // ===============================================================
- // ======================= INPUT =======================================
- Inputs:
- dollarThLong(200), // soglia $ per il LONG
- dollarThShort(200), // soglia $ per lo SHORT
- BPV(50), // Inserisci il big point value ES: @S = 50$ / Big Point Value per Long Per Crypto 1$
- Only_Long(false), // mostra SOLO segnali long
- Only_Short(false); // mostra SOLO segnali short
- // ======================= VARIABILI ===================================
- Vars:
- highPrevSession(0),
- lowPrevSession(0),
- priceThLong(0),
- priceThShort(0),
- sogliaLong(0),
- sogliaShort(0);
- // ======================= CALCOLI IDENTICI ALLO STUDIO =================
- // --- LONG ---
- // High sessione precedente
- highPrevSession = HighSession(1,1);
- // conversione $ → punti
- priceThLong = dollarThLong / BPV;
- // soglia sopra massimo precedente
- sogliaLong = highPrevSession + priceThLong;
- // --- SHORT ---
- // Low sessione precedente
- lowPrevSession = LowSession(1,1);
- // conversione $ → punti
- priceThShort = dollarThShort / BPV;
- // soglia sotto minimo precedente
- sogliaShort = lowPrevSession - priceThShort;
- // ======================================================================
- // SEGNALI DI INGRESSO
- // ======================================================================
- // ───────────────────────────── LONG ─────────────────────────────
- if (Close >= sogliaLong) and
- (MarketPosition = 0) and
- (not Only_Short) then
- begin
- buy ("LongBreakPrevSess") next bar at market;
- end;
- // ───────────────────────────── SHORT ─────────────────────────────
- if (Close <= sogliaShort) and
- (MarketPosition = 0) and
- (not Only_Long) then
- begin
- sellshort ("ShortBreakPrevSess") next bar at market;
- end;
- // ======================================================================
- // USCITA SEMPLICE
- // ======================================================================
- // Solo per test: uscita a fine sessione o all’opposto segnale
- if MarketPosition = 1 and Close <= highPrevSession then
- sell ("ExitLongTest") next bar at market;
- if MarketPosition = -1 and Close >= lowPrevSession then
- buytocover ("ExitShortTest") next bar at market;
Advertisement
Add Comment
Please, Sign In to add comment