1Broker Trading Bot

in #trading6 years ago

If you trade forex on 1Broker, here is a trading bot you might want to try out. There are a couple out there but this one seems to be the most updated one.

The pybroker trading bot allows you to set parameters to automatically open and close trades. It uses the pin bars strategy to open a long or short position with your trades.

https://github.com/7013145/pybroker

Note: "This bot is NOT a guaranteed way to insane gains."

Prerequisite

First, if you don't have a 1broker account then you'll need to sign up and deposit Bitcoins to start trading. You can visit them directly or follow my referral link ;) 1broker.com

Then you'll need to get your API token to use this bot. If you look at the top right you'll see your settings menu. Toggle it and select "Access & API Management".

Then scroll to the bottom and you'll see "Generate API Token".

Once you have your API Token, then you can move on to installing the pybroker trading bot.

Install

This bot runs on python 2.7.9. Most Linux and macOS systems have this preinstalled. You can google "how to install python" if you need to install it.

Install git if you don't have it already.

sudo apt-get install git



Clone the bot from github.

git clone https://github.com/7013145/pybroker 
cd pybroker



Now set your parameters in your config.json file. Here is where you place your 1broker API Token.
sudo nano config.json

{

  "API_KEY" : "YOUR_API_KEY" ,

  "SYMBOL" : "AUDUSD" ,

  "UNIT" : 0.001 ,

  "LEVERAGE_MULTIPLIER" : 1 ,

  "CANDLE_RESOLUTION" : 60 ,

  "STOP_LOSS_MULTIPLIER" : 7 ,

  "TARGET_PIN_SIZE" : 66 ,

  "TRADES_LIMIT" : 3 ,

  "PROFIT_TARGET" : 1 ,

  "PROFIT_TARGET_PERCENT" : 50 ,

  "TAKE_PROFIT" : 1,

  "TAKE_PROFIT_PERCENT" : 100,

  "TOTAL_TRADES_CAP" : 1000

}

Configuration

  • API_KEY : This is here your api key goes, you can find it under "acces & API management" in your profile box.

  • SYMBOL : This is the market you will be trading. i.e AUDUSD, NVDA etc.

  • UNIT : This is the size of orders placed, i.e 0.001 would mean all orders placed use 0.001 BTC of your balance. Default: 0.001

  • LEVERAGE_MULTIPLIER : The maximum allowed leverage is multiplied by this. To use max leverage in your trades, set to 1. If you wanna use half the allowed leverage then set to 0.5. You can also set it to 0 for lowest possible leverage. Default: 1

  • CANDLE_RESOLUTION : This can either be 60, 900, 3600 or 86400. Respectively equals candle periods of 1 minute, 15 minutes, 1 hour, 24 hours. Default: 900

  • STOP_LOSS_MULTIPLIER : When a position is opened, a tight stop loss is placed at a distance under/over the entry price that equals the average percental move from all candles in the chart. So the stop loss will be larger proportional to the candle resolution. However, often you don't want this too tight since the markets will often make swings in both directions before jumping, or diving. The calculated stop loss is multiplied by the value you input here. Default: 7

  • TARGET_PIN_SIZE : This is the measure used to define if a candle qualifies for a pin bar pattern. The "official" definition is that if the "pin" of the candle makes out more than a third of the candle, it is a bull/bear pin. The default value is 66 (pin larger than 66% of whole candle) and i recommend this, but you can play around with it.

  • TRADES_LIMIT : This is the max number of positions the bot will have running. When this is reached, pinbar signals are no longer acted upon till 1 or more active positions are closed. Default: 3

  • PROFIT_TARGET : This is the aggregated BTC profit the bot will stop at. Please be aware that when this triggers, you might have more threads running which the bot will wait for before it exits entirely. Default: 1

  • PROFIT_TARGET_PERCENT : This is the aggregated percental profit the will stop at. Please be aware that when this triggers, you might have more threads running which the bot will wait for before it exits entirely. Default: 50

  • TAKE_PROFIT : This is used to signal an immediate close of a position when certain BTC profit is reached. Can be very useful if you know the range an asset is swinging in. Default: 1

  • TAKE_PROFIT_PERCENT : This is used to signal an immediate close of a position when certain percental profit is reached. Can be very useful if you know the range an asset is swinging in. Default: 100

  • TOTAL_TRADES_CAP : This is the total number of trades the bot will execute before sending a stop signal. Please be aware that when this triggers, you might have more threads running which the bot will wait for before it exits entirely. Default: 1000

This only runs 1 trading pair. If you're looking to run a bot on multiple trading pairs, then you would just need to copy the bot into another directory or clone the github again and edit the config.json file. Keep in mind that it can use up more CPU resources.

Once you are done setting up your configuration, now you can begin to run the bot.
python run.py

If you run into a "cannot find module" errors:

sudo apt-get install python-pip
pip install



If you have your trading bot up and running, it should look like this:

Depending on what you set your parameters, it could take a while for a position to open. Usually, if the CANDLE_RESOLUTION is set to the 60 or 900 then it shouldn't take long for a position to open.

This also sets a trailing stop loss on your positions.

After using this bot for a couple weeks, I set the parameters I wanted and am in profit so just thought I would share this with some of you traders. Enjoy :)




Image Sources: 1,2



Thank you for taking the time to read my post. Feel free to follow and find me in SteemSpeak on Discord.
Sort:  

thank you @bitcoinparadise for the information

This post has received a 7.41 % upvote from @buildawhale thanks to: @bitcoinparadise. Send at least 1 SBD to @buildawhale with a post link in the memo field for a portion of the next vote.

To support our daily curation initiative, please vote on my owner, @themarkymark, as a Steem Witness

Coin Marketplace

STEEM 0.31
TRX 0.12
JST 0.033
BTC 64605.91
ETH 3159.61
USDT 1.00
SBD 4.11