Maurizio-Ciullo

Indicatore Study Sessione_InEntryWindow_PtnBaseSA

Dec 9th, 2025 (edited)
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ////////////////////////////////     Indicatore Study Sessione / InEntryWindow / PtnBaseSA ////////////////////////////////
  3.  
  4. ////////////////////////////////     Plot Session High & Low della Sessione Precedente / InEntryWindow / PtnBaseSA ////////////////////////////////
  5.  
  6. Vars: PrevSessHigh(0), PrevSessLow(0);
  7.  
  8. // Aggiorna solo se valori validi (inizio storico evita 0)
  9. If HighSession(1,1) <> 0 then
  10.     PrevSessHigh = HighSession(1,1);
  11.  
  12. If LowSession(1,1) <> 0 then
  13.     PrevSessLow = LowSession(1,1);
  14.  
  15. // Plot High e Low con colori distinti
  16. Plot1(PrevSessHigh, "PrevSessHigh");
  17. SetPlotColor(1, Green);  // sessione superiore
  18.  
  19. Plot2(PrevSessLow, "PrevSessLow");
  20. SetPlotColor(2, Red);    // sessione inferiore
  21.  
  22. ////////////////////////////////     Indicatore Study Finestra Temporale Long ////////////////////////////////
  23.  
  24. Inputs:
  25.     EntryTimeLong(900),
  26.     EndEntryTimeLong(1130);
  27.  
  28. Vars:
  29.     InEntryWindowLong(false);
  30.  
  31. // Logica fascia temporale
  32. If EntryTimeLong < EndEntryTimeLong then
  33.     InEntryWindowLong = (Time >= EntryTimeLong) and (Time <= EndEntryTimeLong)
  34. else
  35.     InEntryWindowLong = (Time >= EntryTimeLong) or (Time <= EndEntryTimeLong);
  36.  
  37. // Plot sul prezzo solo quando la finestra è attiva
  38. If InEntryWindowLong then
  39.     Plot3(Close, "InEntryWindowLongClosePrice");
  40.  
  41. // Plot booleano 0/1 sempre visibile
  42. Plot4(IFF(InEntryWindowLong, 1, 0), "InEntryWindowLong");
  43.  
  44. // Colori
  45. SetPlotColor(3, Green);   // Long window
  46. SetPlotColor(4, Green);
  47.  
  48. ////////////////////////////////     Indicatore Study Finestra Temporale Short ////////////////////////////////
  49.  
  50. Inputs:
  51.     EntryTimeShort(200),
  52.     EndEntryTimeShort(400);
  53.  
  54. Vars:
  55.     InEntryWindowShort(false);
  56.  
  57. // Logica fascia temporale
  58. If EntryTimeShort < EndEntryTimeShort then
  59.     InEntryWindowShort = (Time >= EntryTimeShort) and (Time <= EndEntryTimeShort)
  60. else
  61.     InEntryWindowShort = (Time >= EntryTimeShort) or (Time <= EndEntryTimeShort);
  62.  
  63. // Plot sul prezzo solo quando la finestra è attiva
  64. If InEntryWindowShort then
  65.     Plot5(Close, "InEntryWindowShortClosePrice");
  66.  
  67. // Plot booleano 0/1 sempre visibile
  68. Plot6(IFF(InEntryWindowShort, 1, 0), "InEntryWindowShort");
  69.  
  70. // Colori
  71. SetPlotColor(5, Red);   // Short window
  72. SetPlotColor(6, Red);
  73.  
  74.  
  75. /////////////////////////////// PLOT PATTERN ///////////////////////////////
  76.  
  77.  
  78. Vars: highd0(0), highd1(0), PtnBaseSA20(false);
  79.  
  80. // Valori sessioni
  81. highd0 = HighSession(0, 0);
  82. highd1 = HighSession(0, 1);
  83.  
  84. // Condizione
  85. PtnBaseSA20 = (highd0 > highd1);
  86.  
  87. // Plot semplice sopra la barra quando TRUE, niente linea a zero
  88. If PtnBaseSA20 then
  89.     Plot7(High + MinMove * 2, "PtnSA20")
  90. else
  91.     NoPlot(7);
  92.  
  93. // Colore
  94. SetPlotColor(7, Blue);  // pattern ora blu
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.      
  103.  
Advertisement
Add Comment
Please, Sign In to add comment