Maurizio-Ciullo

Indicatore Range Threshold Prev Session

Dec 12th, 2025
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.                                                                   // Indicatore Range Threshold Prev Session  //
  3.                                                             // Vedi Anche Versione Study Range Threshold Prev Session //
  4.  
  5.  
  6. // ===============================================================
  7. // Indicatore Range Threshold Prev Session
  8. // Versione Unificata con Input LONG e SHORT Separati
  9. // ===============================================================
  10.  
  11. // ======================= INPUT =======================================
  12. Inputs:
  13.     dollarThLong(200),        // soglia $ per il LONG
  14.     dollarThShort(200),       // soglia $ per lo SHORT
  15.     BPV(50),                  // Inserisci il big point value ES: @S = 50$ / Big Point Value per Long Per Crypto 1$
  16.     Only_Long(false),         // mostra SOLO segnali long
  17.     Only_Short(false);        // mostra SOLO segnali short
  18.  
  19. // ======================= VARIABILI ===================================
  20. Vars:
  21.     highPrevSession(0),
  22.     lowPrevSession(0),
  23.     priceThLong(0),
  24.     priceThShort(0),
  25.     sogliaLong(0),
  26.     sogliaShort(0);
  27.  
  28. // ======================= CALCOLI IDENTICI ALLO STUDIO =================
  29.  
  30. // --- LONG ---
  31. // High sessione precedente
  32. highPrevSession = HighSession(1,1);
  33.  
  34. // conversione $ → punti
  35. priceThLong = dollarThLong / BPV;
  36.  
  37. // soglia sopra massimo precedente
  38. sogliaLong = highPrevSession + priceThLong;
  39.  
  40.  
  41. // --- SHORT ---
  42. // Low sessione precedente
  43. lowPrevSession = LowSession(1,1);
  44.  
  45. // conversione $ → punti
  46. priceThShort = dollarThShort / BPV;
  47.  
  48. // soglia sotto minimo precedente
  49. sogliaShort = lowPrevSession - priceThShort;
  50.  
  51.  
  52. // ======================================================================
  53. //                        SEGNALI DI INGRESSO
  54. // ======================================================================
  55.  
  56. // ───────────────────────────── LONG ─────────────────────────────
  57. if (Close >= sogliaLong) and
  58.    (MarketPosition = 0) and
  59.    (not Only_Short) then
  60. begin
  61.     buy ("LongBreakPrevSess") next bar at market;
  62. end;
  63.  
  64.  
  65. // ───────────────────────────── SHORT ─────────────────────────────
  66. if (Close <= sogliaShort) and
  67.    (MarketPosition = 0) and
  68.    (not Only_Long) then
  69. begin
  70.     sellshort ("ShortBreakPrevSess") next bar at market;
  71. end;
  72.  
  73.  
  74. // ======================================================================
  75. //                         USCITA SEMPLICE
  76. // ======================================================================
  77. // Solo per test: uscita a fine sessione o all’opposto segnale
  78.  
  79. if MarketPosition = 1 and Close <= highPrevSession then
  80.     sell ("ExitLongTest") next bar at market;
  81.  
  82. if MarketPosition = -1 and Close >= lowPrevSession then
  83.     buytocover ("ExitShortTest") next bar at market;
  84.  
Advertisement
Add Comment
Please, Sign In to add comment