Advertisement
Maurizio-Ciullo

Indicatore Study Calcola Secondi Live Per Ingressi Ritardati

Jun 10th, 2023
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.                                                        // Indicatore Calcola Secondi Live Per Ingressi Ritardati //
  3.                             // ATTENZIONE DA FARE SILO SULLO STUDY, SULLO STRATEGY APPENA SI CARICANO GLI INGRESSI DELLA STRATEGIA NON FUNZIONE VARIP !!! //
  4.                         // ATTENZIONE PER FARE DELLE PROVE CORRETTE, ASPETTARE DI AVERE ENTRY = 0.00 SULLA PENULTIMA CANDELA PRIMA DI METTERE L'ALERT ALTRIMENTI ENTRA SUBITO //
  5.  
  6. //@version=5
  7. indicator("Indicatore Study Calcola Secondi Live Per Ingressi Ritardati", overlay=false)
  8.  
  9.  
  10. // Calcolo del tempo con il tempo attuale
  11. //var orario_barra = 0.0
  12. varip secondi_live = 0.0
  13. if barstate.isrealtime and secondi_live != timenow
  14.     secondi_live := timenow
  15. plot(secondi_live, title="secondi")
  16.  
  17.  
  18. plotshape(close > open, title="close > open", color=color.green)
  19. plotshape(close < open, title="close < open", color=color.red)
  20.  
  21.  
  22. entry = 0
  23. if close > open and barstate.isconfirmed
  24.     entry := 1
  25. plot(entry, title="entry")
  26.  
  27.  
  28. time_difference =  secondi_live - last_bar_time
  29.  
  30. // Facciamo una sorta di screen del tempo reale che si aggiorna ad ogni tick appena arriva l'alert o entriamo in posizione e lo confrontiamo con i secondi normali dandogli una differenza in millesecondi aggiunti
  31. // prima di mandare altri ordini per non instasare gli ordini.
  32. if entry == 1
  33.     alert(" Entry Time At (" + str.tostring(secondi_live) + ") Close > open (", alert.freq_once_per_bar)
  34.     //orario_barra := last_bar_time
  35. if entry[1] == 1 and (secondi_live - last_bar_time) > 10000 // 10 secondi di ritardo circa in "millisecondi"
  36.     alert(" Exit Time After 10 Sec (" + str.tostring(secondi_live) + ") Close time position (" + str.tostring(time_difference) +  ")", alert.freq_once_per_bar) // reduce only              {2nda schermata  sell solo stop-loss} {Use SL size from current position}
  37.  
  38. //plot(secondi - orario_barra, "title=sec-temp")
  39. //plot(orario_barra, title="temp_att")
  40. plot(time_difference, title="time_difference")
  41.  
  42.  
  43.                                                                 // Creazione di una label, mettere overlay = true //
  44.  
  45. // if entry == 1 and barstate.islast
  46.    
  47. //     txt = "Time Difference: " + str.tostring(time_difference)
  48. //          +"\nEntry Time: " + str.tostring(timenow)
  49. //         //  +"\nValore_Point: " + tostring(syminfo.pointvalue)
  50. //         //  +"\nMin_Tick: " + tostring(syminfo.mintick)
  51. //     label.new(bar_index, na, text=txt, yloc=yloc.abovebar, color=color.red)  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement