-
Notifications
You must be signed in to change notification settings - Fork 40
generality of dashboard #7
Comments
I appreciate your thoughts, and I'm quite sure others find them useful too. Feel free to open issues here or discuss it on Reddit - both ways are fine in my opinion! So the purpose of the chart is to show you the total value of your current positions + cash. Currently, only limit orders are supported, which means that it is you (the author) of the strategy who must define at which price levels orders are executed. However, if the payload is formatted in a certain way (it has these properties: Example: Regarding your question about subsequent orders not being executed, I see that you've set Lastly, the reason Subsequent events will tell you if the order was placed, rejected or failed, so the return value doesn't mean anything in this setting. I should probably have it return |
I'm out of time for today, but I can see I'll get a lot farther with the info you provided. A lot of my problem was probably due to me forgetting about |
Based on your reply above, in addition to requiring the specified 5 event properties, since "the purpose of the chart is to show you the total value of your current positions + cash", I guess that the dashboard is also usable only in conjunction with context.order invocations. I.e. there's no way to chart anything unless both context.order is invoked, and events populate the 5 required properties? I wanted to leverage your dashboard tool to chart things other than my holdings, such as indicator values or custom calculations based on multiple qualifying stocks. I guess this isn't feasible? |
It may well be that this isn't an issue at all, and I just need help understanding purpose or usage of the dashboard. If I should post questions like to this to the reddit algotrading community or elsewhere, please say so.
I read somewhere in the docs that backtesting and the dashboard are very general and will work for any data, not just market trading. But I can't even get it to work generally with market trading.
Is the purpose of the chart to display only your holdings? Because it if I make no context.order then it displays nothing useful, does not chart the feed values. If I place a single buy then it seems to chart the value of my holding according to subsequent feed events. If I make a buy and later a sell then it seems to chart the value of my holding based only on buy and sell price with no influence by feed event prices. Specifically, I buy at 1.00 (with no correspondence to any feed value) and later sell at 3.00 (with no correspondence to any feed value) and this is charted as a line from 1.00 to 3.00. So in this case the feed data has only indirect influence (if I use it when calculating buy or sell prices in my strategy function).
Why does context.order return false even though it gets successfully requested, created, placed, and filled? Maybe false indicates that it's a backtesting order?
I thought I remembered reading somewhere that order rejections included a reason string. For my rejection events I get back only the same attributes as the order itself. Not useful for troubleshooting.
Now for the really flaky parts.
If I make buys at price 1.00, with my fake stocks, regardless of the feed prices, it goes through, and I can later sell them at this same price. Buys at other prices are rejected. Why a limit order would succeed when it is nowhere near the market prices, I don't know. Do you use some back-trading rules for accepting limit prices, and somehow allow "1.00"? In this strategy callback I can place multiple orders for different stocks at price 1.00 and they all succeed.
But context.order is only working for me in the first strategy callback in which I attempt it. As I said, multiple buys at 1.00 will succeed for multiple stocks. But if I try the same thing (to buy any stock) in a following strategy callback, the buy attempts are always rejected. It would be awesome if you would provide reason detail with rejection events.
I'm attaching my exercise script.
playTrader.js.txt
The text was updated successfully, but these errors were encountered: