Jump to content

KyleK29

Lifetime Members
  • Content Count

    272
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by KyleK29

  1. Did the spreadsheet create that command, or did you make edits (just need to know if I need to make a fix for the spreadsheet)? The TriggerOrder section shouldn't have ";" as it's technically one command. Here is what the TriggerOrder portion should look like: TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice STOPPRICE:StopPrice QTY:Pos TIF:DAY+ ACT:SELL; Fixed command: FocusWindow MONTAGE;StopPrice=Price-0;DefShare=BP*0.99;Share=DefShare*0.25*Price*0.02;Price=Ask-Price+0;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=1000;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice STOPPRICE:StopPrice QTY:Pos TIF:DAY+ ACT:SELL;
  2. Just a heads up (I noticed some people mentioned this in chat the other day as well). With 0.34, it seems the VWAP has a slight issue (see screenshot). It can "lose the line" - the rule marker and montage stay correct, but the line falls behind by a few cents. I don't recall seeing this in previous versions. Changing timeframes doesn't fix the issue, only way I could correct it is to go to Study Config --> VWAP --> Move Up (or Move Down) and it'll reset itself. In the screenshot, the light blue label marker is the correct value for that timeframe (circled), the thick blue VWAP line is not correct.
  3. The portion that uses BP in the $Risk is just calculating the maximum affordable shares. Can you do me a favor and post the hotkey, and the DAS version #? I'll poke around it some more to see if I can replicate the issue. As for the stop, GaryD might be right. I may need to add that to the instructions, I'll test it in a bit. Try GaryD's suggestion. If not, I'll look at it. I know the Trigger order hotkey is very tempermental on whether it'll work or not. So I need to try and replicate the scenarios where it doesn't. Good suggestion, forgot about that. I'll test it and update instructions if it's required.
  4. I finally got around to testing this today. Yes, it uses the available Buying Power to try and refactor the available equity. This can cause it to be smaller and smaller on subsequent orders. Ideally, we'd want an EQUITY variable to calculate the 1% for all trades equally (those without subsequent buying power would be reduced in the MIN equation), using the BP variable makes it so that it gets inaccurate pretty quickly. I've switched all of mine to a flat dollar risk. It helps psychologically as well, since I know in my head what my $risk is. Just have to be more cognizant of your account balance (if live) and update your hotkeys accordingly (so you don't start risking more than 1% unintentionally). I did notice an issue with the automatic STOP order when long on an SSR stock, DAS may block you from scaling out with the stop in place. I went long on AMD today (it was SSR) w/ automatic stop trigger, when I tried to scale out 25% I got rejected for "Short Marketable Limit Order disabled due to SSR!" - DAS calculates that the position size is going to drop below the pending stop order and rejects it because if not updated, the STOP order can convert to a short order (for the balance offset) if triggered. You have to clear the order the order to work around. I wish there was a STOP order that did not convert (e.g. do not cross position 0, change with current position).
  5. No, I don't believe there's an ability to interact with alerts via the chart or hotkeys. It's also worth mentioning that the alert system is a tad buggy at the moment, at least in the latest BETA builds. I'd have to dig up my notes, but the math used for the alerts is way off depending what you choose for the equation (< and <= give completely different results). An alert for a price level will work fine (with a slight bug, see below), but anything using Unrealized, P/L, and Total P/L will give you unexpected results. Here's some of my notes to get around the bugs I've found: TTS --> Doesn't read out beyond the account line if present. Workaround: Type a message into the SYMB box, it'll read that first (e.g. "MAX LOSS HIT") PRICE ALERT --> Readout of price is incorrect. It appends the equation number (I assume it's the operators position in an array) to the price. So for example, a price alert for AMD at 19.40 will give you --> If "<" it'll read AMD 119.4. If "<=" it'll read AMD 219.4, if "=" it'll read AMD 319.4 and so fourth (> is 4, >= is 5). Maxloss does a running balance, depending on the operator used. Examples: P/L <= -150 ---> Expected Result: If actual P/L is less than or equal to -150, send alert. Actual result: Does a running balance, so if you're up $300 on the day and then take a $150 loss, it'll trigger at PnL $150. Not a bad idea for another option (a trailing P/L alert), just not the expected result. Workaround: Use "<" instead. e.g. P/L < -100 ---> This seems to work more appropriately, although I've had it sometimes trigger like the <= operator. Unrealized and TotalPL have similar issues, but are more random because of the inclusion of the unrealized variable.
  6. The price you see in the montage is going to be the portion of the script that is used for your limit order, you won't actually see the other values as they occur too quickly. So what is circled is the calculation of ask + 0.05 --> 158.22 + 0.05 = 158.27. Re: Your prior example for $50 risk, I was slightly off in my calculation. Stop Distance Calculation Portion: Ask - Price + 0.01 --> 21.09 - 20.99 + 0.01 --> .11 --> .11 * 416 = $45.76 risk However, if you double clicked a fractional (e.g. 20.985), that would have populated 20.98 into the price field, on hotkey execution that would be .11 stop distance + 0.01 offset = $50 / .12 = 416 shares (416.66 with the .66 lopped off).
  7. That's the official release version. The beta branch is located here: https://www.dastrader.com/download/fixes/DASInstallDEMO.5.2.0.34.exe I'd recommend making a copy of your current DAS folder before installing that, just as a precaution.
  8. It's calculating the lesser of two values. Example, you can afford 500 shares, but your risk only allows for 416. If you bought 500 shares at the .11 stop distance, you'd be risking $55. 21.09 --> 20.99 (stop + the 0.01 buffer) --> 20.98 (as you said) --> .11 stop distance = .11 * 416 = $45.76 risk. Technically, it should be 454 shares ($49.94 risk), but I think it loses that resolution as it gets rounded a few times in the sequence. The idea is that it won't be exact risk every time, but it'll be lesser and should never be more. I'll have to experiment, but I've switched to Dollar Risk version myself. I think it is something to do with the way DAS reserves buying power, in testing I noticed that stops had a tendency to take up buying power in certain situations. I have a newer sheet coming that includes some improved modifiers. I found some scenarios where the posted modifiers didn't work as expected. It's been a long time since I've used 0.31 (I've never tested it on that version), I'm on 0.34 which includes some bug fixes needed for stops to work. If you don't plan to use the automatic stop orders, you can use the non-BETA version of the excel file. Can you post your DAS logs? They're located in the DAS folder under the LOGS folder I think. Might want to check them to make sure they don't include anything personal. Now, the few times I've seen it calculate a very small share size like that is when the wrong hotkey was used. E.g. you used a LONG hotkey for a SHORT position, it calculates a very small share size (acts kinda like a protection mechanism, as it could be dangerous otherwise).
  9. We were all getting the SSR error last week in sim. Is it still doing it this week? You'd need to create an SSR only hotkey, but try changing it to Bid+0.1 for price. That should get around the rejection. Your fill maybe slightly delayed. This isn't as much of a problem with brokers who use smart routing to put the order in on an uptick. DAS SIM doesn't appear to do this. I think that's what the "add 0.01 to short price on down tick" option is supposed to do, but I don't think it's working.
  10. Just adding that I agree, it does work. Not sure if this is a backend issue or if it's been like this and we've just never noticed it. Being the recent market trends, a lot more stocks are being tagged as SSR. The equation "Ask-.05" just returns a price. Brokers with smart routers (IB, etc.) will place the order on the proper side on an uptick and fill on an uptick for SSR. So placing an order in way below the bid is fine, it just has to trigger and then have an uptick that fills it. In the DAS simulator, it's not doing this. If you put an order in below the BID on an SSR, it rejects it outright. I tested in 5.2.0.31, 0.33, and 0.34. Same thing, so I think it's on the backend. Whether it's a bug or not, I'm not sure. I just don't recall ever having these rejections.
  11. In simulator? I don't believe so, I think they drop the data at 9pm PST, so everything resets. It's why your equity doesn't carry over from day to day.
  12. What language were you planning to do this in? I also started on something a while back, but put it aside as I got busy (was outgrowing Excel's capabilities).
  13. Are you European? It seems that all of the periods were replaced with comma's, I assume this is from an Excel version setup for Europe. Since DAS doesn't support the difference, I'll see if I can force periods for all regions in the spreadsheet.
  14. The DAS SIM account report is weighted to the high-side (e.g. the fees are usually higher than what you'd see). For a breakdown of what fees you're likely to see, you'd want to check the broker you're planning on going with. A decent estimate of ECN fees depending on the route can be found here: https://www.lightspeed.com/pricing/routing-fees/ DAS defaults to 0.003 per share. ECN fees can be cheaper if you use the preferred routes of your broker (Smart Route) versus demanding a certain route. As well as the current SEC fees: SEC -- $13.00 per 1 million shares sold (or $0.000013 of SOLD shares) FINRA -- $0.000119 of SOLD shares For DAS, that'd be: 0.006119 per share
  15. First, check this setting: Montage --> Right Click the area you set the price/etc and select "Trader Settings" --> In the upper left portion, check the box that says "Add 0.01$ to Short Price on down arrow." With that unchecked, if I had to guess, the STOP order maybe beating the initial order because the initial order isn't getting accepted. I'd recommend using a trigger order which only goes in once the initial order is fulfilled. This way you can use the Share=Pos on the stop portion and get an exact position size for that. For examples, check out the spreadsheet here for more ideas: Yours would be: ROUTE=LIMIT;Price=Bid-0.05;Share=BP*0.25 ;TIF=DAY+;HANDINST=ANY;SSHARE=0 ;SELL=Send; StopPrice=last*1.01; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice STOPPRICE:StopPrice QTY:Pos TIF:DAY+ ACT:BUY;
  16. Added a BETA version incorporating Robert H's request for a stop order to be sent with the initial order. If anyone wants to play with this and make sure it's doing what it's supposed to do, please post back. This will likely be the version I make a how-to video on, so if a few people say this is working correctly, I can get that done. Full notes are in the original post under "UPDATES" section. From a prior post, additional hotkeys for modifying the stop-orders. IMPORTANT: If you use a physical stop order you *must* update the position size when you scale in or out, otherwise the order will flip your position. If anyone knows how to prevent that with a command (e.g. only sell/cover to zero position), please let me know. STOP ORDER MODIFIERS: - On "Orders" window (shows pending orders not fulfilled, the stop will be here), double-click the STOP and it'll load into the MONTAGE - Execute a hotkey with the following command Update Existing Stop Order with New Position (e.g. to be done after a scale out): Share=Pos;Replace; Change Stop Position to New Price + Update Position Size (if changed): In This Order: - Orders Window --> Double Click Stop - Double Click area on chart you want to set the stop price to (or type it into the price field) - Execute the hotkey with this command: Share=Pos;StopPrice=Price;Replace;
  17. Not to reply to myself, but I played around with this some more and got the Trigger queue working for the stop, so that way we only send a physical STOP to the market when the initial order is returned as a successful fill. I'll post an update test command in a few minutes. StopPrice=Price;DefShare=BP*0.97; Price = Ask - Price + 0.02; SShare = 120 / Price;Share = DefShare - SShare; DefShare = DefShare + SShare; SShare = Share; SShare = DefShare - SShare; Share = 0.5 * SShare; TogSShare; ROUTE =LIMIT; Price = Ask + 0.05; TIF=DAY+; BUY=Send; DefShare = 400; TriggerOrder=RT:STOP STOPTYPE:MARKET STOPPRICE:StopPrice ACT:SELL QTY:Pos TIF:DAY+; Just a single one for testing in SIM. If anyone wants to hammer and see if you can get some anomalies before I work it into the configuration. What it does: Long: - Moves Double-Clicked price to stop - Does the dollar risk up above calculation ($120 risk) - Setups a Trigger order in queue for STOP with MARKET ORDER at original stop click location, quantity is set to filled quantity. I'll include these additional ones in the video how-to: STOP ORDER MODIFIERS: - On "Orders" window (shows pending orders not fulfilled, the stop will be here), double-click the STOP and it'll load into the MONTAGE - Execute a hotkey with the following command Update Existing Stop Order with New Position (e.g. to be done after a scale out): Share=Pos;Replace; Change Stop Position to New Price + Update Position Size (if changed): In This Order: - Orders Window --> Double Click Stop - Double Click area on chart you want to set the stop price to (or type it into the price field) - Execute the hotkey with this command: Share=Pos;StopPrice=Price;Replace;
  18. Generally, for backtesting you have a few options. -Quantopian : Cloud based, aimed at algorithm development. -Zipline: Local version of Quantopian, tad complex to get setup and running right. -Backtrader: Open Source Python backtester with ability to trade live via the IB API. Learning curve, but probably the best of the free bunch. -Amibroker: Powerful backtest software but expensive ($400 for the complete package). They all will do what you want if you know how to program for them, that's where it gets tricky, as you have to set them up to load in your executions and how to handle the In-trade procedure. The tool I'm developing (and will eventually release to the community) loads your exported trades, caches the minute data for the stock, and then runs a bunch of simulations against that data before producing a report of comparisons to the baseline. For example if you wanted to compare what your PnL looked like if you never moved to breakeven and sold at R.5, R1, R1.5, and R2 levels, it'd do it. The report crunches the benchmark numbers and adds some meta data about each trade (e.g. calculated stop too close, risk reward ratio not adequate, scaled too early, didn't let run) - the goal is to give a broad brush idea to people about areas they may be able to hone their edge (a few trades flagged as scaled-too-early is just noise, a large percentage might be something to look at). The difficult part about this is making it user friendly. Not sure when I'll have it in a state to release, lots of projects at the moment so the passion development has to go on the back burner.
  19. Sorry I've been away guys, a lot of people at Horseshoe Overlook have been counting on me for provisions .... but seriously, I have been very busy. So they fixed the issues that prevented this from working. If you have version 0.34 and want to be a guinea pig (in SIM of course), try this for a long: StopPrice=Price;DefShare=BP*0.97; Price = Ask - Price + 0.02; SShare = 120 / Price;Share = DefShare - SShare; DefShare = DefShare + SShare; SShare = Share; SShare = DefShare - SShare; Share = 0.5 * SShare; TogSShare; ROUTE =LIMIT; Price = Ask + 0.05; TIF=DAY+; BUY=Send; DefShare = 400; ROUTE=STOP;StopType=Market;StopPrice=Round2;SELL=Send; That particular one should: BUY shares adjusted to a maximum risk of $120 (from stop location) and then send the original double-clicked price (your stop) as a STOP market order. I had a few issues with trying to use POS as the stop-order would beat the initial order to market, thus being rejected because you have no open position. To get around that, I sent the stop with the initial share. Now, I'm not sure if that will create an issue with getting a stop in place but having the initial order rejected - hence why it needs to be thoroughly tested. Hopefully they eventually add the ability to "queue" orders via hotkeys that only process once the prior order returns success. Also a note, be very conscious of this when you scale out a position as you have to update the stop's position size, otherwise it'll flip your position. I've tried some of the CANCEL/REPLACE/AUTOCOVER stuff, but I haven't found one that will automatically update a stop's position with each change. An alternative approach would be to create a hotkey to update the position, I've been testing that myself it just requires a separate action elsewhere in the program to do it (better explained in a video). If these pan out, I'll roll them into the configurator sheet. Did you get everything sorted and working? I'll try and throw together a video to help some people out. It doesn't matter in the sense that it's just the value that gets loaded when you click a new symbol (the template value). It's set in the hotkey as we use the DEFSHARE container to store a rather large value that we don't want as the template default shares. So just set it to what you would have set your default-shares in the template manager (I think default in DAS is either 500 or 1000). No. As long as DAS is correctly getting your buying power from the broker (or sim), it will adjust. The script auto calculates what you can afford at the moment of execution (e.g. if you already have a position size of 80,000, it'll only let you use 20,000 .. preventing a rejection). Some of the settings in the config sheet are just to help people understand the values. As RobertH answered, it's a route type. The config sheet includes a ton of routes for the validation dropdown pulled from DAS's route list. The basic ones are usually suffice.
  20. Might want to make the suggestion to DAS (the email is the Help > About part of the program). I've wanted that tool as well, maybe they'll implement it if enough ask.
  21. I'll look at adding that to the new configuration. I tried a lot of combinations for the stop order and saw the same things you saw. Here's what I tried. Move "PRICE" to StopPrice --> Nothing is filled Move "PRICE" to Shares / DefShares / SShares * 100, move to StopPrice / 100 --> Error Message (it'll go into a share container, but it won't come out without error), same with multiplying by 1.00 (to try and force it to be a float) Move "PRICE" to High Price, Low Price, Trail Price --> Error Message From what I can tell, PRICE can write to Shares/DefShares/SShare just fine. StopPrice can write to PRICE. Shares/DefShares/SShares can't convert to write to PRICE (error message). When Route=STOP, "Price" variable = StopPrice variable. That's why if you do StopPrice = Price + .10, it's actually adding .10 to the prior stored StopPrice. Keep hitting that hotkey and it keeps adding .10c to the prior value.
  22. Not likely as this is DAS specific, although I'm sure there's probably a way to do something similar in TWS. I don't have or use it, so I'm unfamiliar with what options they have available.
  23. As a tip, they added a FocusWindow hotkey in version .33. If you give the montage (right click title -> config -> name) a title, you can then set focus before executing the webpage hotkey. Example: Montage window title: MyMontageA FocusWindow MyMontageA; https://finviz.com/quote.ashx?t=%SYMB% Downside is that it'll always use that montage for the SYMB value.
  24. @Robert H So I looked into this last night. It doesn't appear currently possible because of either a design limitation or a bug in DAS. The way I was going to do it was to store the double-clicked value (which gets filled into the montage PRICE field, the "initial stop") in the "StopPrice" variable (switching to ROUTE=Stop and back again). However, it appears that when ROUTE=Stop, the "price" variable is set to "StopPrice", so it's a circular reference (doing StopPrice = price is doing StopPrice = StopPrice). I couldn't find any other places to store the initial price temporarily, as the only floats are available in the STOP route. I also tried converting the datatype, but DAS doesn't support it. Contrary, when ROUTE=Limit, StopPrice is still a valid variable to use. So I'm not sure if this intended or a bug - doesn't seem like it should be this way, as it only has limitations and no upsides I can see.
  25. If it's something the community wants, I can look into it. I'd have to figure out some trickery to store the stop price (the double-clicked price) and retrieve it since I used up all the variables for the main part of the script.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.