Advertisement
Maurizio-Ciullo

Indicatore Print File Txt

Feb 18th, 2023
678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3.                                               // Indicatore Print File Txt //
  4.                                              
  5.                       // Caricare lo script con la strategia inclusa ed il file .txt verrà generato così come i pront log !!! //
  6.                                // Per Fare Il Print Dello Script Bisogna Prima Creare Una Strategia Su Questo Script //
  7.                    
  8. // https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-15-format-date-time/
  9. // https://www.youtube.com/watch?v=49Ta3jYKtxM
  10.  
  11.  
  12.  
  13. if close > close[1] and close[1] > close[2] Then
  14.     buy next bar at Market;
  15. if close < close[1] and close[1] < close[2] Then
  16.     sellshort next bar at market;
  17.  
  18.  
  19. Var: MarkP(0);
  20. MarkP = Marketposition;
  21.  
  22. // Clear the print log when the strategy first applyed or refreshed
  23. Once Clearprintlog;
  24.    
  25.            
  26.  If MarkP <> MarkP[1] and MarkP[1] <> 0 then Begin  // Se siamo a mercato e anche che o da long a short o da da long a flat o da short a flat "se si è concluso un trade"  
  27.     Print(File("C:\Users\morris\Desktop\PrintProfittoStrategy.txt"), Getstrategyname, ", ", Symbol, ", ", Formatdate("dd/MM/yy", ElDateToDateTime( Date )), ", ", BarDateTime.Format( "%H%M.%S" ), ", ", Open, ", ", High, ", ", Low, ", ", Close, ", ", Volume, ", ", Positionprofit(1)); // or yy/MM/dd        
  28.    
  29.     //Questo serve a stampare i log e non a fare il print di un file
  30.     //Print (Getstrategyname, ", ", Symbol, ", ", Formatdate("dd/MM/yy", ElDateToDateTime( Date )), ", ", BarDateTime.Format( "%H%M.%S" ), ", ", Open, ", ", High, ", ", Low, ", ", Close, ", ", Volume, ", ", ); // or yy/MM/dd
  31.     Print(Getstrategyname, ", ", Symbol, ", ", Formatdate("dd/MM/yy", ElDateToDateTime( Date )), ", ", BarDateTime.Format( "%H%M.%S" ), ", ", Open, ", ", High, ", ", Low, ", ", Close, ", ", Volume, ", ", Positionprofit(1)); // or yy/MM/dd        
  32.  End;
  33.  
  34.  //---------------------------------------------------------------------------------------------------------------------------------------//
  35.                             // Esempio di come potrebbe essere utilizzato il codice del print su una strategia //
  36.  
  37.  
  38.  Var: Profitto(0), ProfittoLordo(0),  PerditaLorda(0), Commissioni("DaCalcolare");
  39.  
  40. Profitto = Positionprofit(1);
  41. ProfittoLordo = Grossprofit;
  42. PerditaLorda = Grossloss;
  43. Commissioni = "DaCalcolare";
  44.  
  45. // Questo serve a stampare i log e non a fare il print di un file
  46.  {If MarkP <> MarkP[1] and MarkP[1] <> 0 then    
  47.     print("Inserisci Qui Il Tuo Calcolo);}
  48.  
  49.  
  50. //---------------------------------------------------------------------------------------------------------------------------------------//
  51.                                   // Altro modo per dirgli che eravamo long e che siamo usciti dal trade //
  52.                                         // LONG IF MP = 1 and ( MP[1] <> 1 or TT <> TT[1] ) //
  53.                                        // SHORT IF MP = -1 and ( MP[1] <> -1 or TT <> TT[1] ) //
  54.  
  55. {Var:  MP(0), TT(0);
  56. MP = Marketposition;
  57. TT = Totaltrades;}
  58.  
  59. // Clear the print log when the strategy first applyed or refreshed
  60. //Once Clearprintlog;
  61.  
  62. // We were in a long position and we were not in a position in the last bar OR a trade has been completed
  63. //IF MP = 1 and ( MP[1] <> 1 or TT <> TT[1] ) Then
  64. //  Print(File("C:\Users\morris\Desktop\PrintProfittoStrategy.txt"), Getstrategyname, ", ", Symbol, ", ", Formatdate("dd/MM/yy", ElDateToDateTime( Date )), ", ", BarDateTime.Format( "%H%M.%S" ), ", ", Open, ", ", High, ", ", Low, ", ", Close, ", ", Volume, ", ", Positionprofit(1)); // or yy/MM/dd }        
  65.    
  66. // We were in a short position and we were not in a position in the last bar OR a trade has been completed
  67. //IF MP = -1 and ( MP[1] <> -1 or TT <> TT[1] ) Then
  68.     //Print(File("C:\Users\morris\Desktop\PrintProfittoStrategy.txt"), Getstrategyname, ", ", Symbol, ", ", Formatdate("dd/MM/yy", ElDateToDateTime( Date )), ", ", BarDateTime.Format( "%H%M.%S" ), ", ", Open, ", ", High, ", ", Low, ", ", Close, ", ", Volume, ", ", Positionprofit(1)); // or yy/MM/dd }        
  69.     //Questo serve a stampare i log e non a fare il print di un file
  70.     //Print(Getstrategyname, ", ", Symbol, ", ", Formatdate("dd/MM/yy", ElDateToDateTime( Date )), ", ", BarDateTime.Format( "%H%M.%S" ), ", ", Open, ", ", High, ", ", Low, ", ", Close, ", ", Volume, ", ", Positionprofit(1), ", ", MP) ; // or yy/MM/dd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement