It’s been more than a year since my first post on my journey to create a passive income source that generates a 1% daily return. After spending months testing various bot settings and trigger conditions, I’ve finally achieved a system that is truly hands-off, profitable, automatic trading. I promised to document it on this site, so here it is. Free for you to use.
To be totally transparent, when I say 3,000%, this is APY, which is about a 365% APR, or 1% per day. I know the title is a bit clickbait-ish, but it got your attention, right?
Over the past year and a bit I’ve been struggling to come up with a system that is truly passive. Of course, it doesn’t exist, you always need to be checking and adjusting your bots’ parameters for maximum returns. This system gets as close as you can to being completely passive, with only a few minor adjustments every few weeks. And seriously, as I’m typing this post my Telegram notifications keep going off, letting me know deals are closing constantly. It’s incredible, and a constant reminder the system is working.
So, What Are The Best 3Commas Bot Settings to Use?
The reality is it’s much less about the bot parameters. The most important part is the trigger. Most bot settings will work if you have the right triggers to start a deal. Having said that, I do have some preferred settings I like to use, but these depend on whether the market is ranging (going sideways), or trending (up or down). I will cover these in some later posts, and this post will give you some initial settings to work with. If you don’t want to miss those upcoming posts, make sure you’ve signed up to receive new post notifications to your email if you’re not already.
For the system to work we need a few things first. An FTX.com account. FTX is by far the best exchange in my opinion. Great liquidity, an amazing team, and some of the fairest trading I’ve seen. For example, if you trade leverage, you don’t get instantly liquidated if the price exceeds your margin. Binance and others will instantly just take all your money and leave you broke. FTX will slowly sell off part of your bags to cover your margin, so if your position improves, you’re left with some money to keep trading. Anyways, I digress.
You’re also going to need a Pro plan at 3Commas.io. This system uses two bots per trading pair. One for longs, and one for shorts. You can only run this many on the Pro plan.
Next, you’re going to need Python installed on your machine to run the code. Most computers already have Python installed, so I’m not going to cover how to install it, or anything related to the use of Python. I learned Python through google, so can you. To get up and running fast though, you can download and install the Python IDLE (Integrated Development and Learning Environment) software to make getting started a bit easier.
How The Bot Trading System Works
I had initially come up with a system where I would look for coins or tokens that were breaking out of the pack, and try to start a deal to catch the momentum. The bot would only open and close one deal. I used a comparison chart like this to look for those:
However, this meant I would have to sit and watch the chart all day, all night. Impossible when you have a full-time job and a family. So I sought out a way to automate this. Thanks to the magic of Python and API’s, it’s totally possible.
So, here’s the details.
First we need to connect 3Commas to FTX. This post describes how to make the API connection from 3Commas to FTX. You’ll also need to grab a separate set of keys from both FTX and 3Commas for the python script. That’s pretty straightforward stuff, so google it if you don’t know how.
Next we need to setup all our bots in 3Commas. We’re trading perpetual futures on FTX, and there’s like 140 or so odd perps we can trade. Since we’re going long and short, we need roughly 280 bots setup. Yikes! But no worries, the first python script helps you create the bots. The second then activates all the bots. For some reason you can’t (or I haven’t figured it out yet) create a bot via the API and have it enabled at the same time, so this requires two actions.
Lastly, we’ll run the python script which keeps an eye out on the prices and looks for those tokens or coins that are making a run or tanking, and then tells the correct bot to start a new deal. The bot will take care of the rest, ie managing the safety orders, take-profit, etc. The script will close a deal if it’s gone too far in the red, but you can adjust that parameter, or use a stop loss on the bot, as you wish.
Let’s jump into the techie bits.
Setting Up the Python Script to Automatically Trigger your 3Commas bots
The code is all stored here, and you’re free to use it and modify it as you want. You can click on the green Code button, then on Download ZIP to download a copy on your machine. Unzip the files and keep them in all the same folder.
Setup config.py
Rename the example.config.py
to config.py
. Open the file to edit it. You can use whatever text editor you normally code with, or use the Python IDLE software. The first few lines are where you’ll enter your API keys and sub-account names. The first three are for 3Commas, and the second is for FTX. Paste the keys between the single quotes, and add the sub-account names the same way.

The next few lines determines when the script triggers and closes deals or switches positions.
PAIRS_BLACKLIST
– Add any perps you don’t want bots for. Some of the ones listed already have very low volume and don’t trade well, and for some reasonPERP/USD
gets caught in my filter, so it’s here to make sure we don’t try to call it since it’s not a perp. Add as many as you want, following the same format already in the file.LTF_DELAY
andLTF_INTERVALS
– These work together to determine the time frame you want to look at.LTF_DELAY
sets the time period between checking for the latest prices. The default here is 60 seconds.LTF_INTERVALS
is the number of prices to grab to compare the percentage increase or decrease of a token or coin. The default values are equal to a 5-minute comparison. That’s 60 seconds times 5 = 300 seconds, or 5 minutes. In other words, every 60 seconds we’re going to compare the current price to what it was 300 seconds ago. You can go as long as you want here. I’ve run scripts that check every 10 minutes on a 3-hour window (ie interval of 18).LTF_BULL_CHANGE
andLTF_BEAR_CHANGE
– These are percent values we’re looking to exceed to cause a trigger. The default settings are 2.0% for long bots, and -2.0% for short bots. So, if a token or coin has risen in price (or decreased in price) by this amount in 300 seconds (from the calculation above), the long (or short) bot will be triggered to start a new deal.MAX_OPEN_POSITIONS
– This tells the script the maximum number of deals to run at the same time. The bot will automatically calculate how many deals you can run in parallel based on the funds in your account times the usage of each bot.ORDER_VALUE
,TAKE_PROFIT
, andSTOP_LOSS
– These are not used by the script and will be removed in a future revision.FUNDS_USAGE
– This tells the bot how much of the funds you want to use in your account for the bots. 0.9 will mean 90% of the funds will be used for making deals. Depending on the way you want to play, you might need some funds for rescuing a losing deal.SWITCH_PERCENT
– This is the percentage at which the bot will either close a losing deal or switch it to a short (or long) bot. It’s like a stop loss. You can either jack this up to high value so it doesn’t kick in and use the stop loss from the bot, or not. Your choice. Just remember to make it lower than your last safety order so you don’t prematurely close a deal that might still have a chance of turning around.TREND_STRENGTH
– This value determines if the bot will start deals going against the trend, and at what threshold. Since the bot looks at longs and shorts, it may start deals in both directions at any time, as long as it meets the change percentages in theLTF_BULL_CHANGE
andLTF_BEAR_CHANGE
settings. However, if say the market is trending up on most coins, starting a short deal on a coin or token might not be a good idea. This value helps determine the group strength of a trend. The default value of 65 means that if more than 65% of coins or tokens are trending up, the script won’t trigger any shorts. And vice versa, if 65% of coins or tokens are trending down, the script won’t trigger any longs.OPEN_POSITION_PRIORITY
– These are not used by the script and will be removed in a future revision.
The next lines in the config.py
file are used by the Py3c_create.py
script to generate the bots. These are the same as the bot settings in 3Commas you configure when setting up a bot, so they should look familiar if you’ve setup bots before.
#Create Bot Settings
BASE_ORDER_VOLUME = 10 #IN USD
TAKE_PROFIT = 1.5
SAFETY_ORDER_VOLUME = 10
MARTINGALE_VOLUME_COEFFICIENT = 1.0
MARTINGALE_STEP_COEFFICIENT = 1.5
MAX_SAFETY_ORERS = 4
ACTIVE_SAFETY_ORDERS_COUNT = 3
SAFETY_ORDER_STEP_PERCENTAGE = 0.5
LEVERAGE_CUSTOM_VALUE = 1
I’m not going to address these individually, so if you need more details, have a look through the help docs at 3Commas.
The last group of settings in the config.py
file are used by the Py3c_update.py
script to update your bot parameters. This was necessary since it’s difficult to tweak the bot settings on 280+ bots manually. There’s a few extra fields added here and is really only because the 3Commas API is a bit quirky that way. But it least it gives you a few more options, like adding a stop loss if you want it.
#Update Bot Settings
UPDATE_BASE_ORDER_VOLUME = 10 #IN USD
UPDATE_TAKE_PROFIT = 1.2
UPDATE_SAFETY_ORDER_VOLUME = 10
UPDATE_MARTINGALE_VOLUME_COEFFICIENT = 1.0
UPDATE_MARTINGALE_STEP_COEFFICIENT = 1.0
UPDATE_MAX_SAFETY_ORERS = 4
UPDATE_ACTIVE_SAFETY_ORDERS_COUNT = 3
UPDATE_SAFETY_ORDER_STEP_PERCENTAGE = 1.25
UPDATE_LEVERAGE_CUSTOM_VALUE = 1
UPDATE_STOP_LOSS_TYPE = 'stop_loss' # or stop_loss_and_disable_bot
UPDATE_STOP_LOSS_PERCENTAGE = 0
UPDATE_STOP_LOSS_TIMEOUT_ENABLED = False
UPDATE_STOP_LOSS_TIMEOUT_IN_SECONDS = 300
UPDATE_START_ORDER_TYPE = 'market'
Important: At the moment, you need to make sure the settings in both sections are identical, especially after an update. This is because the script uses settings from #Create Bot Settings
to determine the maximum number of deals it can open. If you update your bots and change the settings via #Update Bot Settings
, and not update the same parameters in #Create Bot Settings
, the script won’t be able to calculate the maximum number of deals correctly. I will fix this in a future update to the code.
Don’t forget to save your changes!
Add Dependencies
The scripts use a couple of external libraries built by some smarter people than me that makes all this possible, at least easier anyways. These include the CCXT library, and the py3cw library. You’ll encounter an error if you don’t first install these. Each of those links describes how to install them, or you can run pip install -r requirements.txt
from inside the folder with the other files. You can also find more general details on setting up/installing everything in this post in the Install Dependencies for Automated Trading Bots and How to Install and Setup Python Automated Trading Scripts sections.
Create Your 3Commas Bots
With the config.py
file and the dependencies installed, we’re ready to create our bots.
We do this with the Py3c_create.py
script. Run the script, either in the IDLE by hitting F5 on your keyboard when the file is open, or from the command line using python3 Py3c_create.py
. Note we use python 3 here, python 2 will not work.
The script will check for existing bot id files. If it’s never been run, these won’t exist and will continue to generate the bots. If the script does encounter existing bot id files, it will ask if you want to over-write them.
The script will then poll FTX and get a list of all available perps and generate a list of bots to create. It will filter out perps from the blacklist setting in the config file, and will also check the minimum order requirements for each coin or token and ignore ones that are too high for your settings. For example, if your base order or safety order values are $10, then you won’t be able to trade BTC, so the script doesn’t create a bot for BTC.
As the script runs it creates the bots on 3Commas via an API connection, and prints out its progress on the screen. It first creates all the long bots, followed by the short bots. It also generates four files, lbotid_list.txt
and sbotid_list.txt
, which contains each token/coin pair and its equivalent bot id on 3Commas. This is basically a lookup table the trigger script will use so it knows which bot id to send the new deal trigger for. The remaining two files are ignored_longs.txt
and ignored_shorts.txt
. These contain a list of pairs that bots were not generated for because of minimum order value requirements. These are not used by any scripts, they’re only there for your reference.
Enable Your 3Commas Bots for Trading
Sadly, it seems when a bot is created via the API it is by default not enabled. Enabling all the bots manually in 3Commas is not all that difficult, but since we have the list of bot id’s, we can do it via a script.
Run the Py3c_update.py
script. The script again checks for existing bot id files and will abort if none are found. Since you already created those in the previous section, you’ll be presented with three choices. Choose the Enable all bots option by typing in the number 2 and hitting enter.
The script will call up each bot and enable it, showing the progress on the screen and when it’s complete.
Start The Money Printing Machine!
If the above is setup as intended and no errors were encountered, you can run the main script using the command:
python3 Py3c_triggers.py
This script will show in the terminal window it’s running, and what it’s doing. Initially, it will spend some time collecting prices, then start sending deal start signals to your 3Commas bots. And that’s it! Sit back and watch the machine run! Occasionally the script will stop running, if the API connection is down – it happens sometimes, so just restart the script and it will continue where it left off. I’ve already configured an error catch for short downtimes and will be adding this in a future version of the script.
If you do run into errors trying to get the script to run, go through the setup again, and google your error – you’ll be surprised at how many solutions are already out there for your exact search. Lastly, drop a comment below and I’ll try to respond as soon as possible.
What’s Next?
This is really the start of this journey. There’s still a bunch of stuff to cover, like….
Will the Python Script Run When I Turn Off My Computer?
Yes, yes it will. The script will stop running when you turn off your computer, it goes to sleep, you lose your internet connection, etc, even for a moment.
For now, run the script on your computer for testing and getting the bot setup and working. It’s a great way to get familiar with editing the config file and understanding how it works.
In another post, I’ll show you how to set this up on the cloud (Virtual Machine) so it can run 24/7, and you can safely turn your PC off at night.
What 3Commas Bot Settings Should I Use?
I’ll cover this as well in a future post. For this particular bot, because we’re just chasing volatility, there’s no real best setting here. Ideally, an all-around type of setting works best, ie one with enough safety orders built in to capture the wild swings, while keeping our win rate times risk-reward high enough, and taking a moderate profit level.
I’ll also write another post on the best 3Commas bot settings to use in a trending market. I’ll add this since it will be perfect for the next python script I’m writing that will trigger based on coins or tokens that are in a trend. With this bot, we’ll want to maximize the amount our bot uses upfront to capture as much profit as possible while maintaining a smaller level of safety orders. I’ve run tests on these settings before, and they truly outperform the typical bot settings. Anyways, stay tuned for that coming up soon.
Don’t Miss What’s Coming Up Next!
Stay up to date on all the posts and how-to’s, Subscribe!
Hi All, it’s been a while since this bot is issued, anyone managed to tweak it to get the best result? mine is having quite a drop, wondering anyone has a better luck tweaking the config to adapt the current market condition?
LikeLike
Hello everyone, I live in the U.S.A. Can I be able to use this script?
LikeLike
Hey Ed,
Unfortunately no. The bot was designed around perpetual futures contracts which aren’t available for trading on Ftx.us, or any other exchanges that allow crypto trading in the US. You can thank your SEC for that!
I’m hoping to get some time in the near future to see how I can make a version for spot that should work in the US.
LikeLike
Nick,
I’m in the same boat over here. I have traded this type of contract with Bybit and a VPN. It has no kyc limits on trading and you can withdraw 2 BTC per day. I have tried to open an international ftx account, but the kyc requirements are too strict to actually do anything.
I am planning to modify your script for usage with Bybit. Any pointers or gotchas that would be unique to ftx?
LikeLike
I did some more digging and it looks like ccxt library supports Bybit, I’m sure there are going to be tweaks such as the pairs naming conventions, but I’ll report how it goes.
LikeLike
Yeah, you should be able to mod it for ByBit fairly easily. I would suggest looking at the format of the returned market data to pull out the pairs you want. They (ccxt) changed this a while back, so the current script is only good if you use an earlier version of the library.
Once you figure out the pair formats, then there are a few places in the script that will need some updating, especially around associating the pair format from the exchange to the pair format 3Commas uses.
Otherwise, it should definitely be doable.
LikeLike
Nick,
Thanks for your quick reply and for making all of this available!
I’ve got the first part of it working, 3commas does not allow Bybit USDT Perps because it has hedging enabled. Even turning off all of the pairs for hedging, I am having trouble instantiating the bots on 3cs (no market data for said pair). However, I think I can use Bybit Inverse Perps, it just has way fewer pairs to work with. I’ll keep chugging and report back here.
Thanks again,
Darren
LikeLike
Hi Nick, thank you for sharing the bot!! as a total n00b it really has inspired me to get started to learn to create my own – or at least figure how to step by step.
When i first tried it out, i found that the market order execution resulted me mainly the peak of the green candle over long trades and vice versa for short trades. I thought about it, what if the bot executed short trades during bull trigger and long trades when the bear trigger signalled. i kept most of the main settings the same, but reduced the TP to 0.65 and increased the SOs to about 7. So the idea was for the initial BO to be the bigger with smaller SOs to execute that quick scalp. I just took the easy way out and renamed lbotid to sbotid and ran the code. While the switch percent function did not work, the trades did execute and close.
LTF_DELAY = 30
LTF_INTERVALS = 5
LTF_BULL_CHANGE = 1.5
LTF_BEAR_CHANGE = -1.5
In a sideways market like what we had in the last 2 weeks of December, it worked. I had higher closure rates focusing on the shorts. The performance exceeded expectations in capturing returns from breakout reversals and vice versa. On only smaller ocassions i had to save trades which didnt pan out.
The trading hours also made a difference, meaning that when premarket opens all the way to the first half of NYSE trading, running the bot on its original settings would yield better results. Closer towards the end of the second half of the trading day, breakout reversals increased, and the quick scalp approach worked better. I was wondering whether in your opinion, this would be hard to code – introducing time rules to execute the original settings or the quick scalp approach. Thanks again!
LikeLike
Hey, thanks for the comment and posting your findings. You’ve actually hit a lot on some of the things I wanted to address in a future post, and possibly as well with an updated script.
As far as bots hitting the peak, this is expected in a way, for two reasons – 1) there’ll always be some coins that “just” make your criteria for starting a trade but then reverse, and it doesn’t matter where you set that trigger. 2) Even with other trigger types, bots will start deals until the entry conditions are no longer met. That always happens at a reversal or at the end of a trend. So the last deal will always seem to be at a peak.
That leads into your bot settings with the higher BO. This is important, since on the way up your bots will be making wins on small deal sizes, but at reversal you DCA the full amount of bot usage until your stop condition. So your winnings need to add up to more than that one reversal to be profitable in the long run. Observing this, you could go with zero SO’s and tighter stops for better results. In a future version of this script I’ll be considering not using 3Commas at all, and making the trades directly on FTX.
Now, in terms of flipping the trades to go in the opposite direction – that is interesting, albeit a different but well known strategy. In this case you’re looking for a regression back to the average after a break-out. It’s not what I had intended for the bot, which was to find and ride a strong trend, but it’s great that works, and definitely a strong case for a future version of the script.
Trading hours – yes, this can be implemented, but probably with an overhaul of the script itself. It would be interesting to see how that continues to play out. For years now I’ve been seeing this type of reversal happening at the end and start of trading days. If the West sees a strong day, the East will typically dump when they come online, taking some profits. And vice-versa, in both directions on either side. I think the point is more that we can expect volatility at those times of the day depending on how the markets moved in between.
LikeLike
Hey can I discuss with you this strategy I am working on an automated bot and I think if you can explain it in more detail I can code it out
Kenchambers.dev
LikeLike
Hi Ken, you can email me at contact@onepercent.blog and we can discuss over email.
Nick
LikeLike
Hi Nick, first l have to take my hat off with what you did here, getting a consistent 1% daily is the holy grail of trading as many have stated, and you managed to find a way to get excellent entries for trades on bots, however l think that perpetual futures and margin trades are risky, if you got this far, why not to use this same entry signals on the spot market? l have been monitoring BTC and ETH for a while, there is at least one good 1% move every day on those, with your bot, its way easier to catch a 2%, 3%, 4% if you are watching the entire market. and although l just made my FTX account, l would rather use binance since that exchange has more volume. What are your thoughts? can this be used on the spot market with a consistent 1% daily? have you tried? Lastly, have you considered making a crypto trading pool using this bots? man l would invest if you did, coding and constantly updating bots requires a lot of mental samina that some of us dont have a lot of. In any case, thanks for your time and your efforts, you are awesome. happy new year btw.
LikeLike
Thanks!
I use perps because it was just easier to filter out in the market data dump from FTX, plus there’s the option to go with some leverage if you wanted to. I wouldn’t say they’re risky compared to spot, only if you’re using leverage then you need to be careful. While I’ve made insane gains using leverage and 3Commas bots (+30% per day on some days), I haven’t used any leverage on this bot to get the 1% gains. Keep in mind the total percentage is extrapolated. I haven’t run this bot continuously for a year as I’m always testing other scripts.
So compared to spot, the gains would be the same since the price correlates and I’m not using leverage on this script.
And yes, you can make bigger gains on some of the moves and that’s what happens, but this averages down since the bot won’t necessarily take profit on the whole amount, but will take a loss on the full amount if you’ve used up all your SO’s and you hit your stop. This all has to factor in to get the 1%.
Binance vs FTX – FTX all the way, not a doubt in my mind. The volume is a little less, yes, but it’s still more than enough, FTX system of liquidation is forgiving vs Binance just takes all your money, and I trust the folks at FTX way more than I trust CZ and Binance.
LikeLike
Hi, did you manage to change the code to use Binance instead of FTX?
LikeLike
Nick,
Given the past couple months have been a bear market, how well has this automation/scripted worked? I am still assessing how to covert this to use only spot trading and to use CBPro or another US allowed exchange. So in the meantime would be curious on well the short side of this model is delivering.
Maybe posted updates on the monthly performance would be great.
LikeLiked by 1 person
I just entered your blog. Awesome, loving it. Going to test yesterday since its too late in the night.
Cheers from Brazil!
LikeLike
I am stuck at the first hurdle. I don’t know where or how to even go about installing the script. Literally I have no idea where to download it to / open it / how to enter the terminal commands / even what terminal is. Is there anyone who could go through an idiots step-by-step for a total beginner? thanks.
LikeLike
Admittedly the instructions on that post are a little abstract, plus I need to update it to add some caveats, or to update the code. If you try to install it you will run into issues because of the ccxt library version (they like to make breaking changes, unfortunately). If you’re just starting out I would suggest this one instead:
https://onepercent.blog/2022/01/16/35-percent-roi-in-15-days-new-automated-trading-script/
It works with the latest versions of all the libraries, and there’s more detail in the installation, including a link to another post describing how to set it all up on a Google VM/server.
LikeLike
first of all, thank you my friend, but I am getting an error, can you help me? Where did I go wrong?
no existing bot ID files found, proceeding….
LikeLike
That doesn’t look like an error. It just means you’re setting up (creating) the bots for the first time. The code checks for existing files before starting so it doesn’t over-write existing bots.
If you get an error, copy and paste the stack-trace so I can see it.
LikeLike
Hi again Nick, l have followed your tutorials on how to set the accounts and the vm machine, aparently l have done everything acording to the instructions, however when l execute the “create” script l get this:
no existing bot ID files found, proceeding….
The following long pairs were ignored, order volume too low: []
The following short pairs were ignored, order volume too low: []
0 long bots created.
0 pairs ignored, order amount to low
0 short bots created.
0 pairs ignored, order amount to low
Ignored pairs can be found in ignored_longs.txt and ignored_shorts.txt
All done, have a nice day!
Which is a problem because there are no bots created to work with, l have 300 usd on my sub account so it shoulnt be a problem, any idea what could l be doing wrong?
Thanks in advance for your efforts and time, l will make sure to reward you kindly for your help
-Zack
LikeLike
Hey Zack,
This is because of breaking changes made in the ccxt library. You’ll need to use an older version. Anything before the date on the linked issue, so maybe 1.63.1, would do it.
So you would do something like
pip3 install ccxt==1.63.1
, for example.I’m hoping to get the script updated soon to work with the latest version.
LikeLike
Hello, i found your article very informative and important. I am recently retired and want to create passive $
. The problem is two fold. I live in the USA and i am only marginally computer adept. Is there a system that will adapt to my need ? Shure do find your article to be inspiring.
LikeLike
Hi Nick,
First off, thank you for sharing! I have been looking into it and I just think it is a work of brilliance 🙂
I have it running now and it is working fine (in a multi bot though). A few questions:
1. It seems that you create a seperate (long and short) bot for every pair, so approx. 280 bots. Any reason for this? Any reason you do not use a multibot?
2. How does it doe over time with red bags? Do you use stop loss or have you experimented with it? What if you have multiple longs open and the market goes really south (for long time / bear market / period)? Do you have a way / system to manage the deals that don’t work out?
LikeLike
Hi Shane!
On this particular script, yes you can do a multi-bot setup. At the time the script was written 3Commas wasn’t setup for multi-bots on FTX perp contracts, that’s a fairly recent addition. It’s definitely easier to manage with the multi-bot, so I’ll be looking at this hopefully in the not to distant future to get it setup that way.
This will really depend on your settings and the market conditions. Personally, I prefer a manual recovery of the red bags, ie by DCA’ing when we’re close to resistance, and hoping for a bounce. In some cases, I also just cut the loss and move on, but will depend on price action and how close/far we are away to/from resistance and how deep my backup funds are 🙂. I don’t find stop losses very effective for DCA bots, it simply locks in too much of a loss. I find it better to try and recover at least some of the deal, even if the bounce is a small one.
LikeLike
Hi Shane,
Can you share the modified code for a multi bot setup?
Best,
Birk.
LikeLike
Thank you Nick! All clear now. Running it for a few days now and happy with the results and the setup.
LikeLike
HI, you use Nick setup as is, or tweak it in any way?
LikeLike
So if you live in NY you pretty much can’t use this strategy, right?
LikeLike
Nope! In fact, thanks to your SEC, no one in the US can (legally) use these scripts since crypto perpetual futures are off-limits.
LikeLike
Hi Nick
Thank you for the great article and for sharing it all with us. I have been quickly reading through the code and have a question to ask. In the Py3c_create.py file, in the “def build_bots()” function on line 170, shouldn’t it read “if shortbots_file.is_file(): os.remove(“sbotid_list.txt”) instead of “if longbots_file.is….”?
LikeLike
Nice catch!!
Incidentally, it shouldn’t affect the execution too much since we’re always creating the files in pairs. I’ll add a fix for this in a future release. Thanks again!
LikeLike
Hi, Nick
I have some problem pls. help me.
Traceback (most recent call last):
File “C:\xxxxxxxxxxxxxn\Py3c_create.py”, line 171, in
build_bots()
File “C:\xxxxxxxxxxxxxn\Py3c_create.py”, line 150, in build_bots
longbot_list, no_long_bots = generate_long_bots(pairs_list, min_price)
File “C:\Users\pakni\Documents\Bitcoin\Trigerbot\3commas-ftx-triggers-main\Py3c_create.py”, line 81, in generate_long_bots
bot_list[key] = data[“id”]
KeyError: ‘id’
Already get account id from manually created bot to TC_ACCOUNT_ID
Already use python version 3.9.2 / ccxt 1.63.1
but not sure that about FTX “SUB_ACCOUNT”
Thankyou
LikeLike
Are you connected to a sub-account in FTX? I would highly recommend this, always, in FTX. This is the only way to isolate leverage on your account. There’s a section in this post on how to setup and connect your 3Commas account to that FTX subaccount.
LikeLike
Hi paknimit, I’ve updated this script now to use the latest version of ccxt, so this should be fixed now. It might be best to re-install the script and update to the latest versions of ccxt and py3cw. I’ve updated the post as well which shows how to use the requirements.txt file to install those dependencies.
LikeLike
This is awesome.
Not to change the subject- but do you have more extensive data on how its been doing in this sidways-down market?
LikeLike
Unfortunately no. I haven’t run this script for a while as I’m always testing others, so I can’t say for sure. To be honest, the market direction shouldn’t have any real impact on how this one performs since we’re just looking for breakouts, then trying to catch and ride the momentum. It would depend as well on your settings – like the timeframe, the percentage value you consider to be a breakout, etc – so this will have some impact on the returns.
LikeLike
I have the same error, although I used your last commit for the script and installed the latest version of ccxt as defined in requrements.
Do you have any idea?
no existing bot ID files found, proceeding….
Error: {‘error’: True, ‘msg’: ‘Other error occurred: not_found Not Found None.’, ‘status_code’: 404}
Traceback (most recent call last):
File “Py3c_create.py”, line 176, in
build_bots()
File “Py3c_create.py”, line 151, in build_bots
longbot_list, no_long_bots = generate_long_bots(pairs_list, min_price)
File “Py3c_create.py”, line 82, in generate_long_bots
bot_list[key] = data[“id”]
KeyError: ‘id’
LikeLike
solve… had a wrong account id for 3commas
LikeLiked by 1 person
First of all, thank you for your great work. I did all setup. And I am getting this after running ‘python3 Py3c_create.py’. Trying to run it for the first time. It’s not creating bots at all because of error:
C:\Users\user\Desktop\python project\3commas-ftx-triggers-main>python3 Py3c_create.py
no existing bot ID files found, proceeding….
Error: {‘error’: True, ‘msg’: ‘Other error occurred: signature_invalid Provided signature is invalid None.’, ‘status_code’: 401}
Traceback (most recent call last):
File “C:\Users\user\Desktop\python project\3commas-ftx-triggers-main\Py3c_create.py”, line 176, in
build_bots()
File “C:\Users\user\Desktop\python project\3commas-ftx-triggers-main\Py3c_create.py”, line 151, in build_bots
longbot_list, no_long_bots = generate_long_bots(pairs_list, min_price)
File “C:\Users\user\Desktop\python project\3commas-ftx-triggers-main\Py3c_create.py”, line 82, in generate_long_bots
bot_list[key] = data[“id”]
KeyError: ‘id’
Thank you!
LikeLike
This is coming from 3Commas:
Most likely an incorrect Account ID or API keys. Make sure to generate a set of API keys for the script (added to config.py) and they have the correct permissions, and make sure your Account ID for the futures account is correct (3Commas creates two for every connection to the exchange, one for spot, one for futures). This is the most common issue I see. This link describes how to get the correct ID: https://onepercent.blog/2021/08/09/make-three-thousand-percent-returns-trading-bots-3commas/comment-page-1/#comment-69
LikeLike
C:\Users\user\Desktop\python1\3commas-ftx-triggers-main>python3 Py3c_triggers.py
Balance: 132.0042
Max bot usage: 50.0
Max positions: 2
Wait 1.00 mins for updated market data. Time: 22:20:31 UTC. [1]/[5]
Wait 1.00 mins for updated market data. Time: 22:21:31 UTC. [2]/[5]
Wait 1.00 mins for updated market data. Time: 22:22:32 UTC. [3]/[5]
Wait 1.00 mins for updated market data. Time: 22:23:32 UTC. [4]/[5]
Wait 1.00 mins for updated market data. Time: 22:24:32 UTC. [5]/[5]
Top Bulls:
FIDA-PERP – 2.80230 %
HNT-PERP – 2.29980 %
Top Bears:
<<<>>>
Traceback (most recent call last):
File “C:\Users\user\Desktop\python1\3commas-ftx-triggers-main\Py3c_triggers.py”, line 347, in
all_open_positions = get_positions()
File “C:\Users\user\Desktop\python1\3commas-ftx-triggers-main\Py3c_triggers.py”, line 206, in get_positions
future = (x[“future”])
KeyError: ‘future’
Any idea why this happens?
– No open orders
– Leverage is just same than in script
– Tried to get new API for new sub-account but same error?
LikeLike
Hey! This can happen sometimes on a new sub account on FTX. Essentially the script can’t find any “futures” in the response, which it can’t currently handle. In Ftx, try buying and then selling one perp in that sub account, it doesn’t matter which perp, just to have some history in the response. Note it has to be a perp.
LikeLike
I switched to fresh sub-account with zero trades, and it seems to work now. Thanks for your help Nick!
Btw, tip for everyone and it’s important! Add ‘SHIB-PERP’ pair to the BLACK_LIST or Py3c_create wont work!
LikeLike
Just to update. Fresh sub-account got error after very first trade it did:
Traceback (most recent call last):
File “C:\Users\user\Desktop\python2\Py3c_triggers.py”, line 347, in
all_open_positions = get_positions()
File “C:\Users\user\Desktop\python2\Py3c_triggers.py”, line 206, in get_positions
future = (x[“future”])
KeyError: ‘future’
It seems like it’s working only for 1 trade on fresh account. If there is any ‘PERP’ trade history it gets this ‘future’ error immediately.
LikeLike
OK, let me take another look at the code and get back to you.
LikeLike
Yeah, there was an error in the latest code update. It’s fixed now. You can either re-download the Py3c_triggers.py file, or make the changes manually by editing the file. Here’s the code block that was changed:
https://github.com/nickpagz/3commas-ftx-triggers/blob/4d58e10e7f8744795859f11a34f249feeff25e78/Py3c_triggers.py#L205-L214
LikeLike
Hey Nick,
after running the script for couple of hours or days, it crashes. Do you know the following problems?
Sometimes I got this error:
Traceback (most recent call last):
File “/root/venv/bot1/lib/python3.7/site-packages/ccxt/base/exchange.py”, line 656, in fetch
response.raise_for_status()
File “/root/venv/bot1/lib/python3.7/site-packages/requests/models.py”, line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: https://ftx.com/api/positions?showAvgPrice=true
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “Py3c_triggers.py”, line 375, in
open_positions = get_positions()
File “Py3c_triggers.py”, line 203, in get_positions
all_positions = ftx.fetchPositions(None, {“showAvgPrice”: True})
File “/root/venv/bot1/lib/python3.7/site-packages/ccxt/ftx.py”, line 1945, in fetch_positions
response = self.privateGetPositions(self.extend(request, params))
File “/root/venv/bot1/lib/python3.7/site-packages/ccxt/base/exchange.py”, line 496, in inner
return entry(_self, **inner_kwargs)
File “/root/venv/bot1/lib/python3.7/site-packages/ccxt/base/exchange.py”, line 547, in request
return self.fetch2(path, api, method, params, headers, body, config, context)
File “/root/venv/bot1/lib/python3.7/site-packages/ccxt/base/exchange.py”, line 543, in fetch2
return self.fetch(request[‘url’], request[‘method’], request[‘headers’], request[‘body’])
File “/root/venv/bot1/lib/python3.7/site-packages/ccxt/base/exchange.py”, line 672, in fetch
skip_further_error_handling = self.handle_errors(http_status_code, http_status_text, url, method, headers, http_response, json_response, request_headers, request_body)
File “/root/venv/bot1/lib/python3.7/site-packages/ccxt/ftx.py”, line 2301, in handle_errors
self.throw_broadly_matched_exception(self.exceptions[‘broad’], error, feedback)
File “/root/venv/bot1/lib/python3.7/site-packages/ccxt/base/exchange.py”, line 566, in throw_broadly_matched_exception
raise broadbroad_key
ccxt.base.errors.ExchangeNotAvailable: ftx {“success”:false,”error”:”Please retry request”}
And sometimes I have this error:
Traceback (most recent call last):
File “Py3c_triggers.py”, line 319, in
perp_change, longs, shorts = change(price[0], price[config.LTF_INTERVALS])
File “Py3c_triggers.py”, line 79, in change
diff = float(new[key]) – float(old[key])
TypeError: float() argument must be a string or a number, not ‘NoneType’
LikeLike
Hi Birk,
This is a 503 error from the ftx API server. Sometimes (especially lately) they’ve been having some issues with their servers being overloaded or going down.
On my later scripts I’ve added code to handle the errors so it doesn’t fail, but it takes some rework of the script to add it into this one. I’ll try my best to get this added here as well.
LikeLike
Hi Birk,
I’ve updated the code to try and capture the connection errors. It’s been working really well on the more recent scripts and should eliminate at least 90% of the errors, unless of course the ftx API is completely offline. The updated file is here:
https://github.com/nickpagz/3commas-ftx-triggers/blob/main/Py3c_triggers.py
LikeLike
Hello to all. is this still valid? i mean anyone was running it past days? went smooth?
thanks in advance!
LikeLike
I haven’t been running this script, but it would still be valid yes, depending on your settings of course.
LikeLike
I’ve encountered an error I haven’t seen in the comment section yet. Have anyone figured out how to resolve this issue?
File “/home/sorhaug92/3commas_bot/Py3c_triggers.py”, line 380, in
cut_positions, switch_positions = evaluate_positions(all_open_positions, price[config.LTF_INTERVALS], top_bull_pairs, top_bear_pairs)
File “/home/sorhaug92/3commas_bot/Py3c_triggers.py”, line 177, in evaluate_positions
for key in positions:TypeError: ‘NoneType’ object is not iterable
LikeLike
This seems like you might be connected to a brand new subaccount with no trade history. If that’s the case, try buying and then selling a perp directly on FTX so there’s at least one item in the trade history for that subaccount.
LikeLike
This solved my issue! Thank you so much Nick 🙂
LikeLike
Hey Nick,
In my decades on the internet, not only is this my favourite blog but you also seem like a really decent person.
I would absolutely love to test out some of your amazing work but vary sadly, all the good stuff is strictly for PERPS. With PERPS banned in so much of the world such as here in England, I wonder if you might be kind enough to consider releasing things in parallel, one for the PERPS you use and then a few amendments for those of us stuck on standard SPOT. I think that would make the blog a favourite for many more people and you will become even more god-like (lol.)
Anyways, fingers crosse you can consider it and keep up the amazing work!
Warmest regards,
Ersatz
LikeLike
[…] The price of BTC moves lower, the bots all hit their stops which is where you buy back your entire position. You literally just made 1% on $1m risking $5m of capital for about 10 seconds. The harder one (but still ridiculously easy) You reverse-engineer the signal so you get it 0.01 seconds before everyone else. https://onepercent.blog › 2021 › 08 › 09 › make-three-thousand-percent-returns-trading-bot… […]
LikeLike
[…] Source: 🔗 […]
LikeLike