-
Notifications
You must be signed in to change notification settings - Fork 4k
Profit reporting & PNL table #693
Comments
Closing this as it's implemented (at least in backtesting). If anyone has any comments feel free to comment them here! |
Could you label buys and sells, and always list the currency value, asset value price, date time, pnl sum, pnl trade pair. The hard part in live is there will be occassions where part fills occur. Then this can require management, like a timeout to pull a buy, a replace buy higher, or pull altogether. In the case of a sell do you chase a sell and so on. I dont know the exact mechanics of this inside gekko today, as I mainly use an alert for now. |
A roundtrip is always one buy and then one sell! Entry is time of buy and Exit is time of sell.
Will extend the chart (this data is already available, just need to add it to the chart).
So a "roundtrip" (still looking for a better name) indicates that the portfolio went from SHORT to LONG to SHORT. It doesn't matter how many orders it took (exit time would be the either the final order execution OR a timerange). The P&L is based on the how much profit was made in total, eg.
Gekko currently keeps on making new orders (every minute on default) until the full balance is flipped. I don't think we need to touch this behaviour. |
Ok that all sounds reasonable. I still prefer buy and sells rather than round trips but maybe that's just me haha 😂 |
Understandable, I am trying to figure out what most people want (I can also
post a table with all trades but like to pick something that 90% of the
people like and understand, instead of presenting way to much information).
This table focusses on P&L and profit calculated per buy/sell as well as
exposure (the idea is that if you trade USD/BTC the BTC is risky while the
USD is more stable, so you want to limit your exposure to (aka the duration you hold) BTC as much as possible - to limit the amount of risk you are taking).
|
What about this? It now shows the balance of the portfolio at entry and exit (eg. how much money you had when you BOUGHT and how much money you had when you SOLD). |
I like it, maybe have a summary of what the currency / asset is. And maybe make Sum Total and TX profits? |
Ok tested this and it looks good 👍 This may be a personal pet hate but would it be possible to state the asset that has changed in the balance and profit columns? Loving the use of the Sharpe ratio :) |
So after a few days of playing with this I think I've come to the conclusion that it would be better to either replace this with the log of buys and sells or have that along side it. I don't believe the round trip gives the right level of detail. |
Is it possible with live trading to get roundtrip information into the pushover plugin so we can show more than just long and short price? |
OK so opening my eyes and reading the ever so helpful documentation and going over the code. Roundtrips are part of papertrader which uses simulated balance. Trader plugin has no idea about the balance until it advices and goes to manager function in which case it decides if it needs to know balance or not depending on exchange. So reading the documents, plug-ins rely on information from events. Candle events and advice events don't carry information on asset or currency balance. Should we have an event that carries information about currency and asset balances? This would be useful for plugins as well as the UI. |
Along these lines, what's the best way to access the portfolio balance from a plug-in? |
@ztnark The profit reporting table gets its data from a "trader" and it does not care about the original datasource. If you run a backtest or a paper trader this "trader" is just a simulation (the paper trader plugin). I am working on integrating the live trader with this system, almost there but it is a lot of work. See #737. |
@askmike Great! Let me know if there are any stories I could help out with. |
Which data represent the data appearing ""entry balance" and "exit balance"? I guess is the value of the currency (for example, bitcoin) on the exchange (for example, bittrex) you are using on the moment you entry (entry balance). At the moment you exit is "exit balance". But, this data doesnt match with the strategys I try. For example: MACD on default configuration for a minute with 1 currency and asset. At 2017-08-24 03:03 the robot exit with 4026.47006852$ as roundtrips table says. You lock on log which was the price at that time on bittrext and say: { Bid: 4148, Ask: 4148.041, Last: 4136 }. So, the data appearing on "entry balance" and "exit balance" could not be the price of bitcoin on entry or exit. I was taking a look to the code but I cant figure out which are the values appearing on "entry balance" and "exit balance". Thanks! ;-) |
A roundtrip is two trades: a buy and than a sell. Entry balance is total balance after the "buy" orders where fully executed. Exit balance is total balance after the "sell" orders where fully executed. It is based on what the "trader" tells Gekko about how the signals from the strat where turned into orders. So this depends on papertrader (or backtest) VS live trader. The first one uses the same market information as the strat uses (eg. candles), the latter uses information on what price your real orders where executed at the exchange. |
Right now gekko can either paper trade (simulate) or live trade on spot markets.
This means:
Knowing this I propose we add a table to Gekko (backtester + live trader) that has all the swings (buy->sell), something like this:
Thoughts?
The text was updated successfully, but these errors were encountered: