freqtrade / freqtrade

Free, open source crypto trading bot
https://www.freqtrade.io
GNU General Public License v3.0
28.09k stars 6.02k forks source link

Show open trades when plot-profit #6142

Closed rongybika closed 2 years ago

rongybika commented 2 years ago

Describe your environment

Your question

Ask the question you have not been able to find an answer in the Documentation

Hi,

Is there any settings to show open trades on ,,every moment" when plot-profit or elsewhere? Because I can't find any. I'm curious to see if I have to set the max-open trades to a higher level or to a lower level(if there is no enough buy signals).

Thank you

xmatthias commented 2 years ago

You can't really at the moment - although the functionality / code for it would be in btanalysis (analyze_trade_parallelism()), so i guess it might be pretty simple to throw that onto a chart ...

konradsemsch commented 2 years ago

I'm not quite sure If I exactly understand how to interpret the graph in the way it's described in the documentation. It says:

image

Now, in the graph the maximum open trade is only 1. Is that intended or did I hinder my strategy in some way through the configuration?

image

Below the configuration file (sorry for the explanatory comments):


{
    "max_open_trades": 10,
    "stake_currency": "USDT", // crypto-currency used for trading
    "stake_amount": "unlimited", // amount used for each trade, by default the current balance is divided by `max_open_trades`
    "tradable_balance_ratio": 0.99, // share of balance available to the bot for trading, 1% is reserved for fees
    // "available_capital": ... - use when running multiple bots
    "fiat_display_currency": "EUR",
    "timeframe": "15m",
    "dry_run": true, // set to false when you want to run in full production mode
    "dry_run_wallet": 1000,
    "cancel_open_orders_on_exit": false, // TODO: should this be true
    // "process_only_new_candles": ... - might be useful to tap into tick data and not only full candles
    "trading_mode": "futures", // change to `futures` to short trade, normally `spot
    "margin_mode": "isolated", // only relevant for trading with leverage or short, set to `isolated` for short trades, normally ""
    "unfilledtimeout": {
        "entry": 10,
        "exit": 10,
        "exit_timeout_count": 0,
        "unit": "minutes"
    },
    // configuration of prices based on the orderbook when buying
    "entry_pricing": {
        "price_side": "same", // keep for consistency
        "use_order_book": true,
        "order_book_top": 1,
        "price_last_balance": 0.0, // will use the `side` price based on orderbook, don't change
        "check_depth_of_market": {
            // TODO: look into this later
            "enabled": false,
            "bids_to_ask_delta": 1
        }
    },
    // configuration of prices based on the orderbook when selling
    "exit_pricing":{
        "price_side": "same", // keep for consistency
        "use_order_book": true,
        "order_book_top": 1
    },
    "recursive_strategy_search": true, // allows to group strategies and their models in subfolders in strategies folder
    "exchange": {
        "name": "binance",
        //"sandbox": true, - can be activated when I want to test binance integration before running the bot live
        "key": "",
        "secret": "",
        "ccxt_config": {},
        "ccxt_async_config": {},
        "pair_whitelist": [ // list of pairs to trade; set in combination with `pairlists` parameter
            "BTC/USDT"       
        ],
        "pair_blacklist": [
            "BNB/.*"
        ]
    },
    "pairlists": [
        {"method": "StaticPairList"}
    ],
    "edge": { // TODO: look into this later
        "enabled": false,
        "process_throttle_secs": 3600,
        "calculate_since_number_of_days": 7,
        "allowed_risk": 0.01,
        "stoploss_range_min": -0.01,
        "stoploss_range_max": -0.1,
        "stoploss_range_step": -0.01,
        "minimum_winrate": 0.60,
        "minimum_expectancy": 0.20,
        "min_trade_number": 10,
        "max_trade_duration_minute": 1440,
        "remove_pumps": false
    }, // TODO: look into this later
    "telegram": {
        "enabled": false,
        "token": "",
        "chat_id": ""
    },
    "api_server": {
        "enabled": true,
        "listen_ip_address": "0.0.0.0",
        "listen_port": 8080,
        "verbosity": "error",
        "enable_openapi": false,
        "jwt_secret_key": "...",
        "CORS_origins": [],
        "username": "...", // this will have to be defined separately when the bot will run in production, in e.g. AWS Secrets Manager
        "password": "..."
    },
    "bot_name": "freqtrade",
    "initial_state": "running",
    "force_entry_enable": false, // allows to force the bot to enter trades via the API or Telegram
    "internals": {
        "process_throttle_secs": 5
    }
}
xmatthias commented 2 years ago

You only have 1 pair in your whitelist - so you implicitly limit your bot to 1 parallel trade (freqtrade won't open multiple positions on the same pair - but you can use callbacks to increase the positions).

konradsemsch commented 2 years ago

Thank you for your answer! Which of the callback functions would be suited for that and is there an example in the document I could take a look at?

xmatthias commented 2 years ago

That's the adjust trade position callback. It's however an advanced callback, and i'd advise to first understand the general functioning and working of freqtrade (by reading through the whole documentation).

konradsemsch commented 2 years ago

I pretty much did that but, didn't get my hands dirty yet with all functionality - work in progress... but thanks for your answer and the package in general. Very impressive work!