Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Indicatore Non Aggiornare Stop 2 Modi Per Realizzarlo //
- // Lo Short Del 2ndo Modo Non Funziona Ci Deve Essere Un Bug !!! //
- //https://www.youtube.com/watch?v=-J9tuRhe3-U&t=78s
- // ------------------------------------ INIZIO INDICATORE NON AGGIORNARE STOP 1 MODO ------------------------------------ //
- var: myStopLong(0), myStopShort(0);
- // Long
- myStopLong = lowd(0);
- print(myStopLong);
- // Short
- myStopShort = highd(0);
- print(myStopShort);
- // Clear the print log when the strategy first applyed or refreshed
- Once Clearprintlog;
- //Entry Long
- {If close[1] > open[1] and close > open Then
- Begin;
- buy ("ENL BreakIntraD") next bar at highd(0) stop;
- End;
- Sell from entry ("ENL BreakIntraD") next bar at myStopLong[Barssinceentry] stop;}
- //Entry Short
- If close[1] < open[1] and close < open Then
- Begin;
- sellshort ("ENS BreakIntraD") next bar at lowd(0) stop;
- End;
- Buytocover from entry ("ENS BreakIntraD") next bar at myStopShort[Barssinceentry] stop;
- // ------------------------------------ FINE INDICATORE NON AGGIORNARE STOP 1 MODO ------------------------------------ //
- // ------------------------------------ INIZIO STUDY NON AGGIORNARE STOP 1 MODO ------------------------------------ //
- //plot1(highd(0), "highd0");
- //plot2(lowd(0), "lowd0");
- // ------------------------------------ FINE STUDY NON AGGIORNARE STOP 1 MODO ------------------------------------ //
- // ------------------------------------ INIZIO INDICATORE NON AGGIORNARE STOP 2 MODO------------------------------------ //
- // Lo Short Del 2ndo Modo Non Funziona Ci Deve Essere Un Bug !!! //
- {var: myStopLong(0), myStopShort(0);
- var: MP(0);
- MP = Marketposition;}
- // Clear the print log when the strategy first applyed or refreshed
- //Once Clearprintlog;
- // Long
- {if MP[1] = 0 and MP = 1 then
- myStopLong2 = lowd(0);
- if MP[1] = 0 and MP = 0 then
- myStopLong = 0;
- print(myStopLong);}
- // Short
- {if MP[1] = 0 and MP = -1 then
- myStopShort = highd(0);
- if MP[1] = 0 and MP = 0 then
- myStopShort = 0;
- print(myStopShort);}
- //Entry Long
- {If close[1] > open[1] and close > open Then
- Begin;
- buy ("ENL BreakIntraD") next bar at highd(0) stop;
- End;
- Sell from entry ("ENL BreakIntraD") next bar at myStopLong stop;}
- //Entry Short
- {If close[1] < open[1] and close < open Then
- Begin;
- sellshort ("ENS BreakIntraD") next bar at lowd(0) stop;
- End;
- Buytocover from entry ("ENS BreakIntraD") next bar at myStopShort stop;}
- // ------------------------------------ FINE INDICATORE NON AGGIORNARE STOP 2 MODO------------------------------------ //
- // ------------------------------------ INIZIO STUDY NON AGGIORNARE STOP 2 MODO ------------------------------------ //
- // Long
- {var: myStop(0), MP(0);
- MP = I_Marketposition;
- plot1(MP);
- if MP[1] = 0 and MP = 1 then
- myStop = lowd(0);
- plot2(myStop);}
- // Short
- {var: myStop(0), MP(0);
- MP = I_Marketposition;
- plot1(MP);
- if MP[1] = 0 and MP = -1 then
- myStop = highd(0);
- plot3(myStop);}
- // ------------------------------------ FINE STUDY NON AGGIORNARE STOP 2 MODO ------------------------------------ //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement