Advertisement
Maurizio-Ciullo

Inizio Indicatore Strategia Grezza Tutor Unger

Mar 30th, 2023
709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //-----------------------------------------------------------------------------------------------------------------------------------------------------//
  2.                                                   // Inizio Indicatore Strategia Grezza Tutor Unger //
  3. //-----------------------------------------------------------------------------------------------------------------------------------------------------//
  4.  
  5. // Questo codice proviene da un tutor di Unger, vedi video su link allegato
  6. // https://www.youtube.com/watch?v=bKCHGBc-ki4&list=WL&index=31
  7. // Vedi video allegato in cartella
  8.  
  9.  
  10. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< INPUTS & VARS DEFINITION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //
  11.  
  12.  
  13. inputs:
  14. Trigger(0),
  15. Exitmode(0), // 0 = always on, 1 = exit at the end of the week, 2 = exit at the end of each session
  16.  
  17. Daysago(3), // [1-5 used only in trigger 6] [1-7 used only for crypto]
  18. DCLenght(100), // used only in trigger 7
  19.  
  20. SL(0);
  21.  
  22. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< INPUTS & VARS DEFINITION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //
  23.  
  24. If Trigger = 1 Then Begin
  25.                If EntriesToday(Date) = 0 Then Buy Next Bar At HighW(0) Stop ;
  26.                If EntriesToday(Date) = 0 Then Sellshort Next Bar At LowW(0) Stop ;
  27. End;
  28.  
  29. If Trigger = 2 Then Begin
  30.                If EntriesToday(Date) = 0 Then Buy Next Bar At HighW(1) Stop ;
  31.                If EntriesToday(Date) = 0 Then Sellshort Next Bar At LowW(1) Stop ;
  32. End;
  33.  
  34. If Trigger = 3 Then Begin
  35.                If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighW(0), HighW(1)) Stop ;
  36.                If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowW(0), LowW(1)) Stop ;
  37. End;
  38.  
  39. If Trigger = 4 Then Begin
  40.                If EntriesToday(Date) = 0 Then Buy Next Bar At HighD(0) Stop ;
  41.                If EntriesToday(Date) = 0 Then Sellshort Next Bar At LowD(0)Stop ;
  42. End;
  43.  
  44. If Trigger = 5 Then Begin
  45.                If EntriesToday(Date) = 0 Then Buy Next Bar At HighD(1) Stop ;
  46.                If EntriesToday(Date) = 0 Then Sellshort Next Bar At LowD(1)Stop ;
  47. End;
  48.  
  49. If Trigger = 6 Then Begin
  50.                If Daysago = 1 Then Begin ;
  51.                   If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1)) Stop ;
  52.                   If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1)) Stop ;
  53.                End;
  54.                If Daysago = 2 Then Begin ;
  55.                   If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1), HighD(2)) Stop ;
  56.                   If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1), LowD(2)) Stop ;
  57.                End;
  58.                If Daysago = 3 Then Begin ;
  59.                   If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1), HighD(2), HighD(3)) Stop ;
  60.                   If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1), LowD(2), LowD(3)) Stop ;
  61.                End;
  62.                If Daysago = 4 Then Begin ;
  63.                   If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1), HighD(2), HighD(3), HighD(4)) Stop ;
  64.                   If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1), LowD(2), LowD(3), LowD(4)) Stop ;
  65.                End;
  66.                If Daysago = 5 Then Begin ;
  67.                   If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1), HighD(2), HighD(3), HighD(4), HighD(5)) Stop ;
  68.                   If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1), LowD(2), LowD(3), LowD(4), LowD(5)) Stop ;
  69.                End;
  70.                If Daysago = 6 Then Begin ; // [1-7 used only for crypto] //
  71.                   If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1), HighD(2), HighD(3), HighD(4), HighD(5), HighD(6)) Stop ;
  72.                   If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1), LowD(2), LowD(3), LowD(4), LowD(5), LowD(6)) Stop ;
  73.                End;
  74.                   If Daysago = 7 Then Begin ; // [1-7 used only for crypto] //
  75.                   If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1), HighD(2), HighD(3), HighD(4), HighD(5), HighD(6), HighD(7)) Stop ;
  76.                   If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1), LowD(2), LowD(3), LowD(4), LowD(5), LowD(6), LowD(7)) Stop ;
  77.                End;
  78.  
  79. End;
  80.  
  81. If Trigger = 7 Then Begin
  82.                If EntriesToday(Date) = 0 Then Buy Next Bar At HighestFC(High, DCLenght) Stop ;
  83.                If EntriesToday(Date) = 0 Then Sellshort Next Bar At LowestFC(Low, DCLenght) Stop ;
  84. End;
  85.  
  86. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< EXIT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //
  87.  
  88. If Exitmode = 1 And Dayofweek(Date) = 5 Then Setexitonclose ;
  89. If Exitmode = 2 And Dayofweek(Date) = 7 Then Setexitonclose ; // [1-7 used only for crypto] //
  90. If Exitmode = 3 Then Setexitonclose ;
  91.  
  92.  
  93. //-----------------------------------------------------------------------------------------------------------------------------------------------------//
  94.                                                   // Fine Indicatore Strategia Grezza Tutor Unger //
  95. //-----------------------------------------------------------------------------------------------------------------------------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement