The Gunbot trading logic and how to make profits
If the purpose of a trading bot is to just buy low and sell high, then why is this thread so long?
That's because it's not so easy to just "buy low, sell high". When are prices low enough to buy? When are prices high enough to sell?
Gunbot offers many different ways to trigger orders, let's have a look of some of the basic concepts and how you can use them in different market situations.
Using EMA to define a buy levelAn EMA (Exponential Moving Average) is a way to visualize average prices over a period of time. This allows you to see when prices are relatively high, because price is above EMA. It also allows you to see when prices are low, because they are below the moving average price.
Take a look at this chart that shows two lines of EMA, one visualizing a moving average over a two hour period (yellow), and one for a four hour period (blue):
What do you learn from this chart? When prices are below both of the EMA lines, it means that prices are lower than both the 2 and 4 hour moving averages. These spots could provide good buying opportunities. However, just being below these two lines does not make it a great entry.
Let's draw a third line, which represents the Gunbot setting for "buy level". In this case, buy level is set to draw 0.5% below the lowest of both EMAs. When price drops below this line, this is where you can actually be fairly sure to "buy low". The green arrows show where Gunbot would buy when setup this way:
Do you agree that these spots would have been good buys?
Gunbot allows you to use the concept of "buy level" in a number of ways, for example you could setup Gunbot to buy when:- Price drops below buy level (just as shown in the chart above)
- Wait for price to hit the lower Bollinger Band, while price is below buy level
- Wait for a trend reversal to happen below buy level
- Trail prices down below buy level, and trade when prices start moving up again
- Use a confirming indicator like RSI to confirm the trade while price is below buy level
Don't like EMA? There are many other options for buyingIf you don't like the concept of "buy level" shown above, you can use Gunbot to trigger trades in completely different ways.
A few examples of the options you could use:- SMACROSS: buy when fast SMA crosses over slow SMA
- MACD: Buy when MACD crosses over the signal line
- Pingpong: Buy when the market reaches a specified price
- Ichimoku: use the Ichimoku indicator to buy, for example, when a candle goes completely below Tenkan-sense
- Time series analysis: Gunbot uses past prices to predict the next price and buys when the actual price crosses below the forecast
- EMASPREAD: buy when the spread between slow and fast EMA starts to decrease
Head over to the Gunbot
wiki to explore even more options!
Strategy examples
Gunbot offers 150+ configuration settings to create trading strategies optimized for all kinds of market situations.
Due to the huge number of different combinations it is impossible to go over every possible setting.
Let's look at a few specific setup examples to deal with different markets.
Gain strategy for a bearish marketThe gain strategy is pretty easy to use, using only a couple settings you can create a powerful strategy based on EMA for buying and reaching specific gain target for selling.
This example uses the "pure" version of the Gain strategy, meaning both the buy method and sell method are set to use gain. No additional trailing or confirming indicators are used.
The following settings were different from the defaults:
- BUY_LEVEL: 0.4
- GAIN: 0.6
- EMA1: 8
- EMA2: 4
The EMA settings are set intentionally short in this case. Combined with a buy level of 0.4% below the lowest EMA, this strategy manages to catch dumps that happen very fast. Gain is set to a modest 0.6% (remember about not being greedy?), this allows for quick scalping even in a bearish market.
SMACROSS strategy for 4h periodUsing SMACROSS has the advantage that you can wait for bigger movements to play out first before trading. This allows for buying after a dump is complete, and selling after a pump is done pumping.
This example uses the "pure" version of the SMACROSS strategy, meaning both the buy method and sell method are set to use SMACROSS. No additional confirming indicators are used.
The following relevant settings were used, all other settings were set to the defaults:
- PERIOD: 240
- SLOW_SMA: 12
- FAST_EMA: 4
- EMA2: 4
EMASPREAD strategy for a volatile marketThe EMASPREAD strategy allows you to go with the flow of the market, buying when prices start to move up after having decreased and vice versa.
This example uses the "pure" version of the EMASPREAD strategy, meaning both the buy method and sell method are set to use EMASPREAD. No additional trailing or confirming indicators were used.
The following relevant settings were used, all other settings were set to the defaults:
- EMA1: 30
- EMA2: 10
- EMAx: 0.5
The settings used in this example use relatively long times for EMA (1.5h and 4.5h) to ignore very small price movements. It triggers trades as soon as the difference between both EMA lines has been at least 0.5% of the current price and the EMA lines start moving closer to each other, signaling a change in price direction.
Pingpong strategy for a predictable marketThe Pingpong strategy is perfect for when the market keeps moving within about the same range. You can setup which price needs to be reached for buying and when to sell exactly. It can result in a great time of trading when the market is just boring.
~Gun