Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bot Trendwide Tradestation
- //Inputs
- input:
- maInputSlow(81),
- maInputFast(15),
- maMinDiff(15);
- // Dichiarazione Variabili
- vars:
- maSlow(0),
- maFast(0),
- chiusura_minima(0),
- condEntryLong(false),
- condExitLong(false),
- condEntryShort(false),
- condExitShort(false);
- // Assegnazione Variabili
- maSlow = xaverage(close, maInputSlow);
- maFast = xaverage(close, maInputFast);
- // condizione entrata/uscita Long e Short
- condEntryLong = close > maSlow and (maFast - maSlow) > maMinDiff;
- condExitLong = maFast cross under maSlow;
- condEntryShort = close cross under maSlow and (maSlow - maFast) > maMinDiff;
- condExitShort = close cross over maFast;
- //Entrata Long
- if condEntryLong Then
- Buy("Long") 1 contracts Next Bar at market;
- // Uscita Long
- if condExitLong then
- Sell("Chiusura Long") from entry("Long") Next Bar at market;
- //Entrata short
- if condEntryShort Then
- Sellshort("Short") 1 contracts Next Bar at market;
- // Uscita Short
- if condExitShort then
- Buytocover("Chiusura Short") from entry("Short") Next Bar at market;
Add Comment
Please, Sign In to add comment