A community for trading strategies, indicators, and utilities developed with HaasScript.
Join for Free Browse Scripts
HaasOnline’s purpose is to help more people gain control of their financial freedom as the new age of finance evolves. As a trusted partner to investors and a leading provider of financial technology, our customers look to us for the solutions they need when designing and executing on their most important trading strategies.
Log('Tip wallet ERC20/BSC: 0xaa28dE4372CA0a8BC36722886E9749f70DF32382') EnableHighSpeedUpdates(true) HideOrderSettings() HideTradeAmountSettings() -- Suggested time interval is 15 minutes. -- Always start with ALL Trade Settings options UN-TICKED to let the bot preparing values. -- Test with default values before changing anything to understand the bot. -- PAY ATTENTION to the log warning...
Hi guys! After years of learning and testing and coping with lockdown and other IRL stuff, here i am back with a new bot script for the community. Smokybot is a trend following bot that using MA and Oscillators. It also has budget management just…
— Author – Strooth – Find me on discord – strooth#4739 — Feel free to donate to support my work or if my script helped you in any way <3 — BTC Adress: 33MsEAbA8tg7SpohgnCpSrmPTBih2UkhxQ — InputGroupHeader('Settings') local positionlimit = Input('Position Limit', 20, 'The number of positions to use') local takeprofit = Input('Take Profit', 100, 'The take profit in ROI to use...
Basic bot/template for managing multiple positions and single order per position with stoploss and take profit Get a signal from where ever you like either from another script or remote signal and it will manage multiple positions both long and short. Requires my other custom…
-- [HaasOnline] Flash Crash Bot -- Author: pshai EnableHighSpeedUpdates(true) HideOrderSettings() HideTradeAmountSettings() --=================================================================== -- == Miscellaneous Usefulness -- deep clone an object function clone(original) local copy = {} for k, v in pairs(original) do if GetType(v) == A...
The FlashCrashBot recreated in HaasScript is here! Ugh.. Almost 1900 lines of code! It was a challenge to create this bot, I can tell you that... This bot differs from the original Custom Bot version, as it contains a bit more safeties, a StartControl and…
NobwRAGmBcCMAcAmADAGjATRgFm2sA6jPgBLHoDiArgJYAmMYJBANgEJsD2AZgPIAiGABYB3AKwBHAEZsAcgDVesAMxh0AFQCeABwCmMAOzJky9AGFOAW0sBDAHZ1ZNy/uhh1AJxt1dXAC4Wdn42NHa6HmpggWEAxn6cEdDg1PSMLNoiUgAKAMrYANJZAJwAMgDWUiQA5jlibDQSQpHRunE0nHYAzjDAALroWTZeLn7hMOBOLoy6AB6tVKORWnowpmAAkp0ASroStB66DNDcNiyduuibJPQ+djAnZxcbnQBiNLosRw/n6ACCLCxOCJZFQAfdTj8wPxdJ0Yh4aNo/O07m5IjkqFUqjCkR0espELBEKh8bA0PiTMSUAA2SmwWDE5TGSnIInksTMorM...
Clean version of BitcoinFib30 Works as is; with 6 % stop loss due to the addition of SAR as a condition :) Enjoy! PS: Williams R% lenght 12 but backtest shows 13 is slightly better. Main time frame of 6 HOURS highly encouraged. This strategy…
NobwRAGmBcCMAcAmADAGjATRgFm2sA6jPgBLHoDiArgJYAmMYJBANgEJsD2AZgPIAiGABYB3AKwBHAEZsAcgDVesAMxh0AFQCeABwCmMAOzJky9AGFOAW0sBDAHZ1ZNy/uhh1AJxt1dXAC4Wdn42NHa6HmpggWEAxn6cEdDg1PSMLNoiUgAKAMrYANJZAJwAMgDWUiQA5jlibDQSQpHRunE0nHYAzjDAALroWTZeLn7hMOBOLoy6AB6tVKORWnowpmAAkp0ASroStB66DNDcNiyduuibJPQ+djAnZxcbnQBiNLosRw/n6ACCLCxOCJZFQAfdTj8wPxdJ0Yh4aNo/O07m5IjkqFUqjCkR0espELBEKh8bA0PiTMSUAA2SmwWDE5TGSnIInksTMorM...
Going through some old scripts doing a bit of clean up. I stumbled upon this old script I compiled very long ago. To be honest I think it was one of the first experiments I have conducted on Haas. To my utter surprise it has…
HideOrderSettings() local risingLength = Input("Rising Length",14,"Rising Length","") local vwapWindow = Input("VWAP Window",100,"VWAP Window","") local stopLossPercentage = Input("Stop Loss Percentage",2, "Stop Loss Percentage","StopLoss") local stopLossShrinkage = Input("Stop Loss Shrinkage",1, "Stop Loss Shrinkage","StopLoss") OptimizedForInterval(0, function() local isSpot = ...
This is a simple strategy that combines the RSING and VWAP Window into a single strategy. Working Defaults: ETH/USD - Perpetuals Interval = 15 Minutes RSING Length = 14 VWAP Window = 100 Stop Loss Percentage = 2 Stop Loss Shrinkage = 1
DefineCommand('BotsUsedMargin', 'Updates and records the highest margin used for all bot open position and their open orders.') local leverage = DefineParameter(NumberType, 'leverage', '', false, Leverage()) local maxPos = Load('mp', 0) local maxOrd = Load('mo', 0) local allPos = GetAllOpenPositions() --local allOrd = GetAllOpenOrders() local totalPos, totalOrd = 0, 0 for i=1, #allP...
A simple command to get bots used position margin information.
-- [pshaiCmd] SuperSmoother - A command to super-smooth any series -- Author: pshai DefineCommand('SuperSmoother', 'A command to super-smooth any series') local src = DefineParameter(ListNumberType, 'source', 'Source values to be super-smoothed', true, ClosePrices()) local len = DefineParameter(NumberType, 'length', 'Length of the super-smoothness', true, 200) local mem_wup = DefineParame...
SuperSmoother ported from a TradingView script. Usage: local hlc = HLCPrices() local mean_line = OptimizedForInterval(0, || CC_SuperSmoother(hlc, 200, 50)) Plot(0, 'Mean', mean_line) Usage (loop): local markets = {'BTC', 'ETH', 'XRP'} for i = 1, Count(markets) do local mkt = CreateMarket({baseCurrency = markets[i]}) local hlc =…
-- Author of haasscript version: Bunka -- REX indicator -- Best used as an exit indicator at default settings. -- Also doing well in entering positions by using TEMA(14) for REX and SMA(14) as signal. local o = OpenPrices() local h = HighPrices() local l = LowPrices() local c = ClosePrices() local rex_ma_type = InputOptions("REX MA type", "SMA", {"EMA","SMA", "Tenkan","TEMA","TRIMA"}) ...
REX indicator Best used as an exit indicator at default settings. Also doing well in entering positions by using TEMA(14) for REX and SMA(14) as signal.
DefineCommand("GetOrderbookImpact", "Calculates the impact on orderbook based on trade amount, returns the price impact in percentages.") local tradeAmount = DefineParameter(NumberType, 'tradeAmount', 'The trade amount to calculate with. Default is TradeAmount()', false, TradeAmount(), 'TradeAmount, MaxLongAmount, MaxShortAmount, LongAmount, ShortAmount') local isLong = DefineParameter(Boolean...
Found another one... Old script, never got published anywhere iinm. The command simply "Calculates the impact on orderbook based on trade amount, returns the price impact in percentages." Hope you find good use for it! ~pshai
NobwRAGmBcBsAsAGANGAmjATJlYDqMuAEoagOICuAlgCYz7wCMATgFIDmRAdgFYByXAMYAjAMoBOAEIBZGgGsAZgGcwqACoBPAA4BTGI0SJGqAMIB7ALYWAhlxp9rFvdDB8dANx3MAogA8qAC54gQAWADJmSiqmZlxcOoIBZsww4JS09GHwcgDSACKi1gCq7ADuEACOeewA8iZKAKwmsBSqYOZxCQFUsSrQwAC6qAAK1syOOgFeqa4T9Dq+CRRTbZq6MADMqACSSgBKOhXUzDp00ArWADZKOjtKRLQ0OlwwF9e3YLsAYlQ6l2dvG6oACCl0uZlKfAoYNeVyBYDyOiUgmYVC03Vi9Daogo7HYSIxL36G0wjEwyBJBgpOC2JMQsGpjGMGw2hmpiHJd...
StopLossCooldown OvercomeFeeCosts NoLoss set 0 what you don't use.
NobwRAGmBcBMAMAaMBNGBGByDqMlgAk9kBxAVwEsATGMAIQBsUAHAFQEUBJAaQAsqGAdgBiARwBa2XhXEBnWWGSsAnswCmMAGzx0yAMIB7ALZGAhgDsqAOVNGN0MABE1AMwrm1hkxZr6D5jwBjABcDACcYcHJqWl4CPW4CNVgAdwB5SwAvACMAVlMAK3Ng81MGRTBDALUQin8FaGAAXWQABVMw2zVgtQjocBs7WjUADxqyHoqVdRgAZmROWQAlNVFKMLUaaBcy2TUF2QJqKjVzGB2GPYPhCjUGLYursABBBgYDFKsyN/Pd/ac1LJAmEKMxgnUzg4KgBlMgAczhgPB/hgwFmsEwiHR6CQ6Pg8zxmixGN0s1m8FxCFgxPguRpAE4aQAWRBMgAc+NZH...
InsuredMH: StopLossCooldown + OvercomeDoubleFeeCosts
-- [pshaiCmd] Trailing Arm Stop-Loss (TASL) -- Author: pshai DefineCommand('TrailingArmStopLoss', 'Educational TASL') local percentage = DefineParameter(NumberType, 'percentage', 'Trailing distance in percentage', true, 1) local arm = DefineParameter(NumberType, 'arm', 'Activation distance in percentage', true, 0.2) local positionId = DefineParameter(StringType, 'positionId', 'Optional po...
A custom command implementation of the built-in TrailingArmStopLoss command for educational purposes.
NobwRAGmBcBMAMAaMBNGBGeSwHUbYAl9kBxAVwEsATGMAawEMB7AFngIDEBlOgEV/QA3AGwAPAA7ChLGsgAqAT3EBTGMPjpkAYSYBbXQwB2VAHINdq6GF7KAZhUPKd+o7LA7DjgMYAXJgCcYcHJqWgB3YRYASWUAUS4AaQAvFnEAdgArAGcWFgyARQBzfMEwbSZPZV8KCqyYYABdZAAFBn9zZR9lQOhwMwtaZVEqsi6ysEUVGABmZCisgCVlAEdKf2UaaFsGABss5TmsgmoqZUMYbb2DsHmOCmUdzcv95ABBHZ2mMJMyD4vdl7WZRZLz+CjiHw1c5WcZcMiFQrAyEVerTWDoWCINGYLEIWZo+DCXHoTTTaZYXHwTEEgCslIAnJSWIgWAAOeCzNnw...
MHB_Safeties - [kobalt] MHB_Safeties: StopLossROI, DeactivateOnLoss, ProfitTrailer, HighSpeedUpdates
-- Author: pshai DefineCommand('BreakEven', 'Sets or triggers a stop-loss at breakeven after X% breached.') local min_prc = DefineParameter(NumberType, 'min_prc', 'Minimum required percentage price change for safety to activate', true, 1, 'Number, Input') local max_rebounds = DefineParameter(NumberType, 'max_rebounds', 'Number of rebounds allowed before triggering the safety', false, 0, 'Nu...
Here is a simple Break Even Safety command. The inputs for the commands are: - Minimum required percentage price change for safety to ACTIVATE - Number of rebounds allowed before TRIGGERING the safety - Optional position ID How it works: When your bot enters a…
-- Author: Strvinmarvin -- Market Scanner and Example of Unified Data Object arrCoins = { '1INCH', 'AAVE', 'ACM', 'ADA', 'ADX', 'AERGO', 'AGLD', 'ALCX', 'ALGO', 'ALICE', 'ALPACA', 'ALPHA', 'AMP', 'ANKR', 'ANT', 'ANY', 'AR', 'ARPA', 'ATA', 'ATM', 'ATOM', 'AUCTION', ...
This snippet takes a list of coins and checks the Maker Fee for them. It also serves as an educational example for how to utilize a Unified Data Object, for which I got the idea from Strooth and Pshai and since implementing a simple version…
DefineCommand("PlotVarColor", "Used like a regular plot command but you have a variable color") local palette, varmodif, varcolor, varLO, is_LO, clr, LineOptsID, LineName, x, a, b, t_modif, chartid, name, values, color_or_LO chartid = DefineParameter(NumberType, "Chart ID", "", true, 1) name = DefineParameter(StringType, "Line Name", "", true, "Line") values = DefineParameter(ListD...
When converting from PineScript to HaasScript, it's pretty common to find colors changing on some condition. This function imitates TV's variable color plotting (including the weird color extension backward when a new colored datapoint comes in). Also has built-in PlotCircle and PlotBars capability as an…
Finalize(function() open_positions = GetAllOpenPositions() --Get Unrealized gains total for report open_value = 0 --Get lowest open ROI % lowest_roi_list = {} lowest_roi_string = '' if Count(open_positions) > 0 then for i = 1, Count(open_positions) do open_value = open_value + open_positions[i].profit lowest_roi_list = ...
This snippet checks for open positions and reports the lowest 'x' number of them in a Custom Report. Useful for Dashboard reporting and Backtesting, especially with multiple markets or positions running in a single bot.