Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Indicatore Print File Txt //
- // Caricare lo script con la strategia inclusa ed il file .txt verrà generato così come i pront log !!! //
- // Per Fare Il Print Dello Script Bisogna Prima Creare Una Strategia Su Questo Script //
- // https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-15-format-date-time/
- // https://www.youtube.com/watch?v=49Ta3jYKtxM
- if close > close[1] and close[1] > close[2] Then
- buy next bar at Market;
- if close < close[1] and close[1] < close[2] Then
- sellshort next bar at market;
- 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 // 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"
- 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, ", ", ); // or yy/MM/dd
- 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
- End;
- //---------------------------------------------------------------------------------------------------------------------------------------//
- // Esempio di come potrebbe essere utilizzato il codice del print su una strategia //
- Var: Profitto(0), ProfittoLordo(0), PerditaLorda(0), Commissioni("DaCalcolare");
- Profitto = Positionprofit(1);
- ProfittoLordo = Grossprofit;
- PerditaLorda = Grossloss;
- Commissioni = "DaCalcolare";
- // Questo serve a stampare i log e non a fare il print di un file
- {If MarkP <> MarkP[1] and MarkP[1] <> 0 then
- print("Inserisci Qui Il Tuo Calcolo);}
- //---------------------------------------------------------------------------------------------------------------------------------------//
- // 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 }
- // 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement