Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Funzione Print File Txt //
- // Caricare sia la funzione che la Strategia sullo Strategy !!! //
- // Per Fare Il Print Della Funzione Bisogna Prima Creare Una Strategia //
- // https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-15-format-date-time/
- // https://www.youtube.com/watch?v=49Ta3jYKtxM
- //---------------------------------------------------------------------------------------------------------------------------------------//
- // Esempio della funzione per stampare sia su file .txt si sui log una strategia richiamando la funzione //
- Var: MarkP(0);
- MarkP = Marketposition;
- // Clear the print log when the strategy first applyed or refreshed
- Once Clearprintlog;
- If MarkP <> MarkP[1] and MarkP[1] <> 0 then Begin
- //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
- Print(File("C:\Users\morris\Desktop\PrintEasyLanguage.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
- End;
- FunzionePrintFileTxt = 0; // Nella strategia ricopiare: FunzionePrintFileTxt = 0; alla fine del codice !!!.
- //---------------------------------------------------------------------------------------------------------------------------------------//
- // Altro modo per dirgli che eravamo long e che siamo usciti dal trade //
- // LONG IF MP = 1 and ( MP[1] <> 1 or TT <> TT[1] ) //
- // SHORT IF MP = -1 and ( MP[1] <> -1 or TT <> TT[1] ) //
- {Var: MP(0), TT(0);
- MP = Marketposition;
- TT = Totaltrades;}
- // Clear the print log when the strategy first applyed or refreshed
- //Once Clearprintlog;
- // We were in a long position and we were not in a position in the last bar OR a trade has been completed
- //IF MP = 1 and ( MP[1] <> 1 or TT <> TT[1] ) Then
- //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 }
- //Questo serve a stampare i log e non a fare il print di un file
- //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
- // We were in a short position and we were not in a position in the last bar OR a trade has been completed
- //IF MP = -1 and ( MP[1] <> -1 or TT <> TT[1] ) Then
- //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 }
- //Questo serve a stampare i log e non a fare il print di un file
- //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
- //FunzionePrintFileTxt = 0; // Nella strategia ricopiare: FunzionePrintFileTxt = 0; alla fine del codice !!!.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement