Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Bot Over-The-Clouds ETH/USDT.P BYBIT 4H LONG E SHORT //
- // Versione con uscita chiusuare sotto la baseline //
- // Il trading system completo - Over The Clouds ETH/USDT.P BYBIT 4H LONG E SHORT (Trend Following)
- // (Sviluppo Dati Exchange = BINANCE + BYBIT) (BINANCE Dal=18/08/2017 Al 21/10/2020) (BYBIT Dal=21/10/2020 Al 20/05/2023)
- // (Exchange= BYBIT) (Sottostante ETH-USDT.P) (Timeframe= 4H) (Direzione= LONG E SHORT) (Swing Posizione= SI) (Esclusione Ore=NO) (Esclusione Giorni=NO) (Esclusione Mesi=NO)
- // (Take Profit Long/Short Market = NO) (Take Profit Limit Long/Short= NO)
- // (Stop Loss Limit Long= NO) (Stop Loss Limit Short= NO) (Stop Loss Market Long/Short= SI) (Trailing Stop Market=SI) (Stop Emergenza= NO)
- // (Rischio Operazione 2% Perdita Media Calcolato Sul Ticker: ETHUSDT BINANCE SPOT) (Max Drawdown Permesso 10,03%) (Calcolato Sul Ticker: ETHUSDT.P BYBIT CHE E' IL PEGGIORE DELLE ENTRIES MODE)
- // (In Sample Dal=18/08/17 Al 12/07/22) (Out Of Sample Dal=12/07/22 Al 20/05/23)
- // (Money Management = 23% Del Capitale Pinesctipt)
- // (Money Management = 25% Del Capitale Tradestation)
- // (Progettatta Il=07/07/23)
- // Caricamento Dati Bybit Su Tradestation: Exchange Time, Regular Session, 7x7 23:00 23:00, Session Hour.
- // ATTENZIONE //
- // Quando si mette la strategia live, ricordarsi di impostare 1 solo input "quello che vogliamo utilizzare come normal/ more_aggressive/less_aggressive entries" su true e
- // impostare gli altri su false. Commentare anche i BUY COMMAND che non utilizziamo.
- // Auentare il Max Bars Back A 75 Su Tradestation Altrimenti Non Funziona E Cliccare Su Enable Strategy Altrimenti Non Parte
- // Qui a differenza di tradingview non ho creato lo swith mode per gli ingressi cambiando periodi atr e mopltiplicatore atr, farlo a mano dagli input.
- ////////// Start detecting Ichimoku Cloud //////////
- Inputs: Standard(26), Turning(9), Delayed(52), Uscita(0), mystop(0), myprofit(0);
- Variables:StdLine(0), TurnLine(0), Span1(0), Span2(0);
- StdLine = (Highest(High, Standard) + Lowest(Low, Standard)) / 2; // "BASE LINE"
- TurnLine = (Highest(High, Turning) + Lowest(Low, Turning)) / 2; // "CONVERSION LINE"
- Span1 = (StdLine + TurnLine) / 2; // "SPAN A No 25 Offset"
- Span2 = (Highest(High, Delayed) + Lowest(Low, Delayed)) / 2; // "SPAN B No 25 Offset"
- // Span1 e Span2 non hanno l'offset di 25 candele fa, per ulteriori verifiche vedi Study Ichimoku oppure fare il print qui su Strategy.
- // Print Debug Ichimoku
- {Once Clearprintlog;
- print(Getstrategyname, ", ", Symbol, ", ", Formatdate("dd/MM/yy", ElDateToDateTime( Date )), ", ", BarDateTime.Format( "%H%M.%S" ), ", ", Close, ", ", StdLine, ", ", TurnLine, ", ", Span1, ", ",Span2 , ", ",);
- print(StdLine);
- print(TurnLine);
- print(Span1);
- print(Span2);}
- ////////// End detecting Ichimoku Cloud //////////
- ////////// Start Detection ATR (Average True Range Long E Short) //////////
- // Valori migliori e più stabili boom bar long I migliori sono scritti per prima: //7-.1.2//12-1.2 //11-1.2
- // La 7-1.2entra più facilmente ed entra più in basso solo che se il periodo non è buono prende più stop
- // La 11-1.2 entra meno, operazione leggermente minore ma se il periodo è peggiore prende meno stop
- // Preferisco la 7-1.2 Più aggressiva e la 11-1.2 più stabile
- input:
- input_atr_period_long(7),
- input_atr_period_short(33),
- input_atr_Mult_long(1.2),
- input_atr_Mult_short(1.2),
- input_ema_long(84),
- input_ema_short(83),
- InitialCapital(100000),
- percent_risk(100),
- only_long(false),
- only_short(false);
- Vars:
- valore_atr_long(0),
- valore_atr_short(0),
- boom_bar_long(false),
- boom_bar_short(false),
- ema_long(0),
- ema_short(0),
- entrata_long(false),
- entrata_short(false),
- uscita_long(false),
- uscita_short(false),
- nr_share(0),
- risk(0);
- ////////// Start Detecting ATR (Average True Range Long E Short) //////////
- valore_atr_long = AvgTrueRange(input_atr_period_long);
- valore_atr_short = AvgTrueRange(input_atr_period_short);
- ////////// End Detecting ATR (Average True Range Long E Short) //////////
- ////////// Start Detecting Boom Bar Long //////////
- boom_bar_long = Absvalue(open - close) > valore_atr_long * input_atr_Mult_long;
- If boom_bar_long Then
- // Plotshape Boom_Bar_Long
- Begin
- Value1 = Text_new(D, T, L, "*");
- Text_setcolor(Value1, Yellow);
- Text_setstyle(Value1, 2, 0);
- End;
- ////////// End Detecting Boom Bar Long //////////
- ////////// Start Detecting Boom Bar Short //////////
- boom_bar_short = Absvalue(open - close) > valore_atr_short * input_atr_Mult_short;
- If boom_bar_short Then
- // Plotshape Boom_Bar_Short
- Begin
- Value2 = Text_new(D, T, L, "*");
- Text_setcolor(Value1, Yellow);
- Text_setstyle(Value1, 2, 0);
- End;
- ////////// End Detecting Boom Bar Short //////////
- ////////// Start Detecting Media EMA Long //////////
- ema_long = XAverage(close, input_ema_long);
- ////////// End Detecting Media EMA Long //////////
- ////////// Start Detecting Media EMA Short //////////
- ema_short = XAverage(close, input_ema_short);
- ////////// End Detecting Media EMA Short //////////
- ////////// Start Money Managment //////////
- risk = percent_risk/100;
- nr_share = floor((InitialCapital + NetProfit) * risk) / close;
- ////////// End Money Managment //////////
- ////////// Start Condizioni Entrata E Uscita Long E Short //////////
- entrata_long = close > StdLine and TurnLine > StdLine and close > Span2 and close > ema_long and boom_bar_long and not only_short;
- entrata_short = close < StdLine and TurnLine < StdLine and close < Span2 and close < ema_short and boom_bar_short and not only_long;
- uscita_long = close < StdLine;
- uscita_short = close > StdLine;
- ////////// End Condizioni Entrata E Uscita Long E Short //////////
- ////////// Start Entrata E Uscita Long //////////
- if marketposition = 0 and entrata_long Then
- Begin;
- Buy("Long") nr_share contracts Next Bar at market;
- End;
- if marketposition = 1 and uscita_long Then
- Begin;
- Sell("Exit Market Long") from entry("Long") Next Bar at market;
- End;
- ////////// End Entrata E Uscita Long //////////
- ////////// Start Entrata E Uscita Short //////////
- if marketposition = 0 and entrata_short Then
- Begin;
- Sellshort("Short") nr_share contracts Next Bar at market;
- End;
- if marketposition = -1 and uscita_short Then
- Begin;
- Buytocover("Exit Market Short") from entry("Short") Next Bar at market;
- End;
- ////////// End Entrata E Uscita Short //////////
Advertisement
Comments
-
- can you make PREDICTUM INDICATOR & gg shot indicator code..??
Add Comment
Please, Sign In to add comment
Advertisement