This is a sample strategy to inspire you.
More information in https://www.freqtrade.io/en/latest/strategy-customization/
You can:
:return: a Dataframe with all mandatory indicators for the strategies
- Rename the class name (Do not forget to update class_name)
- Add any methods you want to build your strategy
- Add any lib you need to build your strategy
You must keep:
- the lib in the section Do not remove these libs
- the methods: populate_indicators, populate_buy_trend, populate_sell_trend
You should keep:
- timeframe, minimal_roi, stoploss, trailing_*
# Strategy interface version - allow new iterations of the strategy interface.
# Check the documentation or the Sample strategy to get the latest version.
INTERFACE_VERSION = 2
# 设定最小投资回报
minimal_roi = {
60 : 0.01,
30 : 0.02,
0 : 0.04
# 止损
stoploss = -0.10
# 指标参数
buy_rsi = IntParameter(low=1, high=50, default=30, space= buy , optimize=True, load=True)
sell_rsi = IntParameter(low=50, high=100, default=70, space= sell , optimize=True, load=True)
# K线时间
timeframe = 5m
# 在新K线出现时执行
process_only_new_candles = False
# These values can be overridden in the ask_strategy section in the config.
use_sell_signal = True
sell_profit_only = False
ignore_roi_if_buy_signal = False
# 预准备K线数
startup_candle_count: int = 30
# 下单类型
order_types = {
buy : limit ,
sell : limit ,
stoploss : market ,
stoploss_on_exchange : False
# 订单有效时间(gtc: 除非取消否则一直有效)
order_time_in_force = {
buy : gtc ,
sell : gtc
plot_config = {
main_plot : {
tema : {},
sar : { color : white },
subplots : {
MACD : {
macd : { color : blue },
macdsignal : { color : orange },
RSI : {
rsi : { color : red },
def informative_pairs(self):
Define additional, informative pair/interval combinations to be cached from the exchange.
These pair/interval combinations are non-tradeable, unless they are part
of the whitelist as well.
For more information, please consult the documentation
:return: List of tuples in the format (pair, interval)
Sample: return [( ETH/USDT , 5m ),
( BTC/USDT , 15m ),
return []
def populate_indicators(self, dataframe: DataFrame, metadata: dict) - DataFrame:
Adds several different TA indicators to the given DataFrame
Performance Note: For the best performance be frugal on the number of indicators
you are using. Let uncomment only the indicator you are using in your strategies
or your hyperopt configuration, otherwise you will waste your memory and CPU usage.
:param dataframe: Dataframe with data from the exchange
:param metadata: Additional information, like the currently traded pair
:return: a Dataframe with all mandatory indicators for the strategies
炒币没你想的那么简单,不是倒买倒卖就赚钱无数,一个合格的炒币者,不仅要懂得经济、要跟踪新闻热点、了解国家政策、关心国际形势,要研究虚拟币的基本面、技术面,而且,要不停地与自己的恐惧与贪婪作斗争。要有一颗大心脏,经的起大起大落,从无到有,从有到无,经的起诱惑,受的起折磨,可以说,从币圈活下来的人基本上都是百折不挠、百毒不侵、百炼成钢!
了解更多币圈一线报道,与作者、读者更深入探讨、交流,欢迎大家来一起交流,互相学习!
------
延伸阅读:
币圈炒币要先学好技术
炒币要先学好技术,积累出一定经验,在牛熊市的实战中反复演练,水淮方能水涨船高,此外别无他法。
学习用简单的东西去分析看大盘,先是从小币种来看大盘,小币种的活跃度,第一板涨幅怎样,热点板块龙头操作思路,后看熟悉比特币主力的操作思路,最后加成交量就先知趋势会怎样。
成功,等于小的亏损,加上大大小小的利润,多次累积。做到不出现大亏损很简单。
以生存为第一原则,当出现妨碍这一原则的危险时,抛弃其他一切原则。因为,无论你过去曾经,有过多少个100%的优秀业绩,现在只要损失一个100%你就一无所有了。
交易之道,守不败之地,攻可赢之敌。100万亏损50%就成了50万,50万增值到100万却要盈利100%才行。
每一次的成功,只会使你迈出一小步。但每一次失败,却会使你向后倒退一大步。从帝国大厦的第一层走到顶楼,要一个小时。但是从楼顶纵身跳下,只要30秒,就可以回到楼底。
在交易中,永远有你想不到的事情,会让你发生亏损。需不需要止损的最简单方法,就是问自己一个问题:假设现在还没有建立仓位,是否还愿意在此价位买进。答案如果是否定,马上卖出,毫不犹豫。!
------------------
欢迎阅读
推荐阅读:
比特币现金资料介绍
CEUR币怎么买卖交易?CEUR币上线了哪些交易所?
比特币物联网(比特币物理钱包安全吗)
FORGE币怎么买卖交易?FORGE币上线了哪些交易所?
十大数字货币交易平台排行 比特币国际站推荐(全)
CATHEON币价值如何?CATHEON币值得长期投资吗?
全球比特币交易所排名,世界十大btc交易所排行榜
TRAD币价值如何?TRAD币值得长期投资吗?
SIGNA币价值如何?SIGNA币值得长期投资吗?
比特币合约交易什么意思?