Advertisement
Maurizio-Ciullo

Study Session Last Bar

Aug 20th, 2022 (edited)
1,018
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                                                 //  Study Session Last Bar Tradestation  //
  2.                                      // Individua l'ultima barra della sessione su grafico intraday  //                                            
  3.                                                
  4.                            
  5.  
  6.            // Questo Sistema Conta Le barre Perchè E' Più Facile Fargli Capire Determinate Ore Quando Cambia Giornata //
  7.                               // SessionLastBar Di Multicharts Viene Sostituito Dalla Riga Di Codice Che Segue //
  8.      // Il conteggio delle barre parte da 0 che cade sull'ultima barra di sessione per avanzare di uno ad ogni barra successiva //
  9.    
  10.  
  11.  
  12. // Questo plot verifica sia SessionLastbar sia il mycount che conta le candele a partire da SessionLastBar per poi riazzerandole ogni volta.                           
  13. // Dayofweek(Date) Per la settimana borsistica va da 0 a 5 Per le criptovalute da 0 a 7.               
  14. // Mycount va da  da 0 a 23 su timeframe orario.
  15.  
  16.  
  17.                    
  18. Var:                   
  19. SessionLastbar(0);
  20.  
  21.  
  22.  
  23. { *** INIZIO VERSIONE ORIGINALE COUTER DI SESSIONE NON SEMBRA ESSERE SINCRONIZZATA ***
  24.  
  25. if Time = (SessionEndTime( 0 , CurrentSession(0))) then SessionLastbar = 100 else SessionLastbar = 0;
  26.  
  27. If SessionLastbar = 100 then mycount = 0;  // Uso 100 Al Posto Di True Perchè Altrimenti Mi ritorna Errore !!! .
  28. mycount = mycount + 1;}
  29.  
  30. //*** FINE VERSIONE ORIGINALE COUTER DI SESSIONE NON SEMBRA ESSERE SINCRONIZZATA ***
  31.  
  32.  
  33.  
  34.  
  35. // *** INIZIO VERSIONE SECONDARIA COUTER DI SESSIONE SEMBRA ESSERE SINCRONIZZATA ***
  36.  
  37. if Time = (SessionEndTime( 0 , CurrentSession(0))) then SessionLastbar = 0 else SessionLastbar = SessionLastbar + 1;
  38.  
  39. If SessionLastbar = 0 then mycount = -1; // Controllare se mettere then mycount = 0 opure mycount = - 1 dato che mi ritorna 1 invece di 0 vedi plot !!! .
  40. mycount = mycount + 1;
  41.  
  42. // *** FINE VERSIONE SECONDARIA COUTER DI SESSIONE SEMBRA ESSERE SINCRONIZZATA ***
  43.  
  44.  
  45. {plot1(CurrentSession(0));
  46. plot2(Time);
  47. plot3(Sessionendtime(0, currentsession(0)));}
  48. plot4(SessionLastbar);
  49. plot5(mycount);
  50. plot6(Dayofweek(Date));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement