Advertisement
Maurizio-Ciullo

Study Plot Su Strategy

Feb 4th, 2023
981
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                
  2.                                              // Study Plot Su Strategy //
  3.                                                                    
  4.   // Inizio Come plottare: Equity / Contratti / Prezzo Medio / Market Position / Open Equity / Current Shares Su Un Indicatore Basato Su Una Strategia //
  5.            
  6.  
  7. // Creare Un' indicatore   
  8. // Programe Assumes Only One Trade Can Close On The Bar
  9. // Le Keyword Usate Per Un'indicatore Sono Diverse Da Quelle Usate Per Lo Strategy
  10. // Link youtube: https://www.youtube.com/watch?v=0xXsC6DaGFA
  11.  
  12.  
  13. // Queste sono alcune keywords per lo study:       
  14. {I_Closedequity
  15. I_Currentcontracts
  16. I_Avgentryprice
  17. I_Marketposition
  18. I_Openequity
  19. I_Currentshares}
  20.  
  21.  
  22. Vars:       ClosedNetProf(0),
  23.             LastTradP(0),
  24.             NumWins(0),
  25.             TotWinsNP(0),
  26.             AvgWin(0),
  27.             MaxWin(0);
  28.  
  29. ClosedNetProf = I_Closedequity;
  30.  
  31. If ClosedNetProf > ClosedNetProf[1] Then
  32. Begin
  33.     LastTradP = ClosedNetProf - ClosedNetProf[1];
  34.     Print(D, T, "LastTradP", LastTradP);
  35.     NumWins = NumWins + 1;
  36.     TotWinsNP = TotWinsNP + LastTradP;
  37.     AvgWin = TotWinsNP / NumWins;
  38.     MaxWin = Maxlist(MaxWin, LastTradP);
  39. End;
  40.  
  41. Plot1(TotWinsNP, "TotWinsNP", Red);
  42. Plot2(AvgWin, "AvgWin", Blue);
  43. Plot3(MaxWin, "MaxWin", Yellow);
  44. // Se nei numero di trades che prendo come calcolo non ci sono vittorie allora non potrò dividere per per 0
  45. If NumWins - NumWins[50] > 0 Then Plot4((TotWinsNP - TotWinsNP[50]) / (NumWins - NumWins[50]), "AvgWin50BarsAgo", Magenta);
  46.  
  47.   // Fine Come plottare: Equity / Contratti / Prezzo Medio / Market Position / Open Equity / Current Shares Su Un Indicatore Basato Su Una Strategia //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement