Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-----------------------------------------------------------------------------------------------------------------------------------------------------//
- // Inizio Indicatore Strategia Grezza Tutor Unger //
- //-----------------------------------------------------------------------------------------------------------------------------------------------------//
- // Questo codice proviene da un tutor di Unger, vedi video su link allegato
- // https://www.youtube.com/watch?v=bKCHGBc-ki4&list=WL&index=31
- // Vedi video allegato in cartella
- // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< INPUTS & VARS DEFINITION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //
- inputs:
- Trigger(0),
- Exitmode(0), // 0 = always on, 1 = exit at the end of the week, 2 = exit at the end of each session
- Daysago(3), // [1-5 used only in trigger 6] [1-7 used only for crypto]
- DCLenght(100), // used only in trigger 7
- SL(0);
- // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< INPUTS & VARS DEFINITION >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //
- If Trigger = 1 Then Begin
- If EntriesToday(Date) = 0 Then Buy Next Bar At HighW(0) Stop ;
- If EntriesToday(Date) = 0 Then Sellshort Next Bar At LowW(0) Stop ;
- End;
- If Trigger = 2 Then Begin
- If EntriesToday(Date) = 0 Then Buy Next Bar At HighW(1) Stop ;
- If EntriesToday(Date) = 0 Then Sellshort Next Bar At LowW(1) Stop ;
- End;
- If Trigger = 3 Then Begin
- If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighW(0), HighW(1)) Stop ;
- If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowW(0), LowW(1)) Stop ;
- End;
- If Trigger = 4 Then Begin
- If EntriesToday(Date) = 0 Then Buy Next Bar At HighD(0) Stop ;
- If EntriesToday(Date) = 0 Then Sellshort Next Bar At LowD(0)Stop ;
- End;
- If Trigger = 5 Then Begin
- If EntriesToday(Date) = 0 Then Buy Next Bar At HighD(1) Stop ;
- If EntriesToday(Date) = 0 Then Sellshort Next Bar At LowD(1)Stop ;
- End;
- If Trigger = 6 Then Begin
- If Daysago = 1 Then Begin ;
- If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1)) Stop ;
- If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1)) Stop ;
- End;
- If Daysago = 2 Then Begin ;
- If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1), HighD(2)) Stop ;
- If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1), LowD(2)) Stop ;
- End;
- If Daysago = 3 Then Begin ;
- If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1), HighD(2), HighD(3)) Stop ;
- If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1), LowD(2), LowD(3)) Stop ;
- End;
- If Daysago = 4 Then Begin ;
- If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1), HighD(2), HighD(3), HighD(4)) Stop ;
- If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1), LowD(2), LowD(3), LowD(4)) Stop ;
- End;
- If Daysago = 5 Then Begin ;
- If EntriesToday(Date) = 0 Then Buy Next Bar At Maxlist(HighD(0), HighD(1), HighD(2), HighD(3), HighD(4), HighD(5)) Stop ;
- If EntriesToday(Date) = 0 Then Sellshort Next Bar At Minlist(LowD(0), LowD(1), LowD(2), LowD(3), LowD(4), LowD(5)) Stop ;
- End;
- If Daysago = 6 Then Begin ; // [1-7 used only for crypto] //
- 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 ;
- 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 ;
- End;
- If Daysago = 7 Then Begin ; // [1-7 used only for crypto] //
- 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 ;
- 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 ;
- End;
- End;
- If Trigger = 7 Then Begin
- If EntriesToday(Date) = 0 Then Buy Next Bar At HighestFC(High, DCLenght) Stop ;
- If EntriesToday(Date) = 0 Then Sellshort Next Bar At LowestFC(Low, DCLenght) Stop ;
- End;
- // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< EXIT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //
- If Exitmode = 1 And Dayofweek(Date) = 5 Then Setexitonclose ;
- If Exitmode = 2 And Dayofweek(Date) = 7 Then Setexitonclose ; // [1-7 used only for crypto] //
- If Exitmode = 3 Then Setexitonclose ;
- //-----------------------------------------------------------------------------------------------------------------------------------------------------//
- // Fine Indicatore Strategia Grezza Tutor Unger //
- //-----------------------------------------------------------------------------------------------------------------------------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement