Jump to content

KyleK29

Lifetime Members
  • Content Count

    272
  • Joined

  • Last visited

  • Days Won

    48

Posts posted by KyleK29


  1. 18 hours ago, Sean S said:

    @KyleK29 and @GaryD,

    Thank you for the response. Mine is still not working. Below is the link I got from the spread sheet. The share sizes were calculated accurately, just no stop loss order was sent afterwards.

    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=ROUTE:STOP;STOPTYPE:MARKET PX:StopPriceSTOPPRICE:StopPrice;Share=Pos;TIF:DAY+ ACT:SELL;

    Please assist.

    Thank you.

    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.

     

    VWAP_Issue_MU_DasTrader_2018-12-12_08-03-01.thumb.png.ec4634acc8ac99c7ea34a6d8bc8b56a8.png

    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. On 12/10/2018 at 1:19 PM, Robert H said:

    Thanks, Kyle.

    I found that even using the dollar risk version, the diminishing available BP was still an issue. I'm assuming this is because it still contains the DefShare=BP*X variable.

    I've since switched to a more simple version based on @fjmocke original hotkey:

    Price=Ask-Price + 0.02;Share=100 / Price;ROUTE=SMRTL;Price=Ask+0.05;TIF=DAY+;BUY=Send

    As we know, the downside is being rejected based on insufficient BP. I manage this by copy/pasting my Withhold BP from DAS to Excel.

    For some reason I couldn't get the STOP orders to work at all. Maybe I'm doing something wrong.

    On behalf of the BBT Team: thanks again for all the work!

     

    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.

    18 hours ago, Sean S said:

    @KyleK29, this spread sheet is amazing! How did you even come up with codes like these?

    Quick Question though. The trigger order for stop loss seems not working. These is no stop loss order sent afterwards. I've tried to set up a hotkey for stop loss orders, but the only post I can find is 

    This code is setting the stop trigger price to a set value which is $.30 below the cost, but what if I want to double click the mouse on the chart, and then press the hotkey to set the stop price right there? Can we do that? In that case we can keep changing our stop losses as the price moves.

    Please assist.

    Thank you.

    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.

    8 hours ago, GaryD said:

    @Sean S, I have no trouble getting the stop orders to trigger using the spreadsheet macros. I found that they work if the Montage is set to style "STOP", and do not work if set to "DEFAULT". Give that a try.

     


    Good suggestion, forgot about that. I'll test it and update instructions if it's required.


  4. On 12/3/2018 at 4:53 PM, Robert H said:

    @KyleK29 Thanks for adding the STOP order feature! I will test in simulator and report back. Awesome work on the Stop Order Modifiers, too.

    I ran into an issue today while having multiple positions opened. Note I am using the % Equity Risk version of the hotkeys. I believe using the Dollar Risk version may avoid this.

    So I opened position 1, risking 1% of my account. My buying power is now reduced by what is used by position 1. All is well.

    I open position 2 using the same hotkey as above. However, I am now risking much less than 1% since the calculation is based off available buying power (of course).  This leads to a much smaller position than what was intended. It gets worst if you open a third or fourth position. Note that my buying power is never fully consumed. Each subsequent position is just calculated based off the decreasing available BP.

    I'm going to manually calculate 1% of my equity and use the Dollar Risk version. Will report back on results.

    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. On 12/5/2018 at 8:02 PM, GaryD said:

    Let me start off by saying I love DAS. After much wasted time, and even more wasted money, I am completely convinced that DAS is the best day trading platform out there (I use it with IB). However, I have struggled with alerts in DAS. They are too cumbersome to setup and adjust . Since I am with IB, I have TWS open and use it for all my alerts. I can easily click and drag the alerts around, and add them just by right-clicking on the chart. Does DAS have the ability to show alerts on the chart, and maybe drag them to new levels, or even right-mouse the alert on the chart to edit? In my opinion, this seems to be one area that DAS could improve, although I might be missing something, like the ability to set an alert using a hot key where you double-clicked on the chart?

    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.

    • Thanks 1

  6. On 12/4/2018 at 5:33 PM, Martin G said:

    @ragycpa

    With a 20 cent risk on a $150 stock, you cannot afford the 500 shares.  In this situation the script should calculate the number of shares you can afford to buy at 95% (or other percentage if you changed this on the first sheet in the workbook) of your buying power and send the order for that.  When I tested this for $50 and $100 risk on NVDA with ASK as shown below just now and it worked correctly.  Interestingly, when the hotkey was pressed and the order loaded, the price then changed to 158.27 which apparently would be my average price for the purchase with the ASK offers pictured.

     

    ASK AvgPrice.JPG

     

    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. On 12/4/2018 at 8:18 PM, ragycpa said:

    @KyleK29

    Thanks for your help Kylek. I signed for two weeks trail on DAS website and they sent me a link to download the platform. When I went to Help——-About it shows the version which is .31. Is it because of the simulator?

    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. On 12/1/2018 at 10:11 AM, Martin G said:

    Hi all!  I'm new here and currently in SIM.  I loaded two of the HotKey scripts to test.

    I have $30K buying power, $5K equity configured since I'm eventually headed to CMEG.

    $50 fixed risk.  (This is edited to only load the trade.)

    DefShare=BP*0.95; Price = Ask - Price + 0.01;SShare = 50 / 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=Load; DefShare = 100

    Ask 21.09, double-clicked 20.99.  20.98 populated into the Price field on my montage.  Hit the hotkey and it loaded 416 shares.  Since my 95% of my buying power can easily afford 500 shares at an Ask of 21.09 with , I was surprised.  This is 83% of my intended shares/risk.

    $100 Fixed Risk:  (Also to load, not send)

    DefShare=BP*0.95; Price = Ask - Price + 0.01;SShare = 100 / 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=Load; DefShare = 100;

    With the same scenario as above, this one loaded 833 share...  also 83%.

    Any ideas why it is doing this?  

     

     

    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.

    On 12/3/2018 at 4:53 PM, Robert H said:

    @KyleK29 Thanks for adding the STOP order feature! I will test in simulator and report back. Awesome work on the Stop Order Modifiers, too.

    I ran into an issue today while having multiple positions opened. Note I am using the % Equity Risk version of the hotkeys. I believe using the Dollar Risk version may avoid this.

    So I opened position 1, risking 1% of my account. My buying power is now reduced by what is used by position 1. All is well.

    I open position 2 using the same hotkey as above. However, I am now risking much less than 1% since the calculation is based off available buying power (of course).  This leads to a much smaller position than what was intended. It gets worst if you open a third or fourth position. Note that my buying power is never fully consumed. Each subsequent position is just calculated based off the decreasing available BP.

    I'm going to manually calculate 1% of my equity and use the Dollar Risk version. Will report back on results.

    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.

    On 12/3/2018 at 5:16 PM, ragycpa said:

    Hi All

    I am new to the community and this is my second day on SIM. I have three questions about the hotkeys script. 

    Does this script buys/short based on the account equity or the buying power?

    I am planning to use CMEG in the future giving my small trade account, and CMEG has 16% margin maintenance for stocks over $4. How can we incorporate that into this script?

    The SIM is version 5.3.31, what excel file should I use, the beta?!

     

    Thanks!

     

    29 minutes ago, ragycpa said:

    @Martin G

    Thanks for your quick response. My situation is similar to yours. I am currently trading in SIM and eventually will head to CMEG for starting with smaller account. However when I applied the script you have mentioned with the same account size $5000 and 6:1 leverage, it bought me only 4 shares for AMD $21/share. I don’t know how the script bought me this. I guess I am not using it right. Should I double click on the stop loss I am targeting, or the entry price for the trade? Also I tried to load the script but it did not work. Any advice?

    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. On 11/19/2018 at 9:27 AM, traderkevin90 said:

    Thank you Kyle! I changed the montage to add 0.01 to short but nothing so far. I also changed my hot button to what you recommended:

    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;

    but then i get this msg:

    Send_Rej Shrt 14 SQ 64.06 --SMAT--12:26:18--Short marketable limit order disabled due to SSR!
    order send pending!

    but my order wont show up on "Orders"

    not sure what else I could try. 

     

    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. On 11/20/2018 at 7:17 AM, Michael said:

    This does, in fact, work.

    E.g., ROUTE=SMRTL;Price=Bid+.01;Share=2000;TIF=DAY+;SELL=Send

    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. 1 hour ago, Jens said:

    Hello,

    I'm having a using this hotkey. When I hit my hotkey the following error pops up. I'm using the following scripts:

    Long $20 dollar risk:

    DefShare=BP*0,97;Price=Ask-Price+0,02;SShare=20/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;

    Short $20 dollar risk:

    DefShare=BP*0,97;Price=Price-Bid+0,02;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price=Bid-0,05;TIF=DAY+;SELL=Send;DefShare=400;

    image.png.1b14c3ef8c0bbae813e9d90bd59bb361.png

    Can someone help me with this problem? Thanks in advance.
     

    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.

     


  12. On 10/19/2018 at 11:57 AM, Seamus said:

    Robert.

    Thank you for the explanation. I do notice in my training Sim the ECN charge is at the $.003 per share cost. Of course, I'm trading very heavy at this point in the learning process however, I notice your screen shot has zero dollars in the ECN cell. Quick read of your link speaks of creating liquidity (credit) and not creating liquidity (debit). I have been following the advice from the group about bidding into a trade with the +/- $.05 idea for immediate entrance. Am I understanding correctly this would be defined as not creating liqudity and thus, charged $.003 fee per share at some point when I go live? If so, and assuming the screen shot provide is yours, how do you go about entry to avoid such a fee?

    Much appreciated.

    seamus

    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

     


  13. On 11/8/2018 at 8:40 AM, traderkevin90 said:

    Hello,

    I have a hotkey script which is as follows:

    ROUTE=LIMIT;Price=Bid-0.05;Share=BP*0.25 ;TIF=DAY+;HANDINST=ANY;SSHARE=0 ;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=last*1.01;Share=BP*0.25;TIF=DAY+;HANDINST=ANY;BUY=SEND

    This is for short selling. My issue is whenever there is an SSR on a stock and I  choose to SHORT which only happens on upticks...it turns into a normal buy order.

    How can I change this to get it to buy on uptick but still be a short order??

    Thanks!


     

    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."

    tradersetting.thumb.png.8aef83632e1e4b95c29410bb372c5985.png

    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;


  14. 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;

     

    • Like 1

  15. 19 hours ago, KyleK29 said:

    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.

    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;

     

    • Like 1

  16. 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.

     

    • Like 4

  17. 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.

     

    On 10/24/2018 at 8:40 PM, Robert H said:

    @KyleK29 I am amazed by how much effort you've put into this solution. Thank you on behalf of the entire Bear Bull Traders Team!

    Would it be possible to automatically send a STOP MARKET order along with the buy/sell execution? The following script only sends a STOP with some arbitrary price relative to Average Cost:

    Share=Pos;ROUTE=STOP;StopType=Market;StopPrice=AvgCost-0.10;TIF=DAY+;SELL=SEND

    How cool would it be to double-click your stop level, automatically calculate share size, send the order, and send a stop order with the press of one hotkey. Thanks!

    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.

    On 11/4/2018 at 2:17 PM, altqer said:

    I understand that, the prices are correctly entered in the Price field in the Montage window after I double click on the chart. It's just that the hot keys don't work most of the time.

    Did you get everything sorted and working? I'll try and throw together a video to help some people out.

    On 11/6/2018 at 9:19 AM, nmarnson said:

    Just to clarify, the default shares really doesn't matter right? Since it will change depending on the stop loss. 

    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).

     

    On 11/9/2018 at 6:22 AM, nmarnson said:

    Do I need to create a new hotkey whenever my account equity changes?

    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.

     

    On 11/11/2018 at 9:18 PM, stephenlee said:

    Quick question! 

     

    What does SMRTL mean?

    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.


  18. 14 hours ago, Michael P said:

    I put the script in exactly as above. No Buy, Price, or Route tokens.

    The excel thing is kind of a shame as the range variables in Sheets are more elegant, but referring to each cell instead works in both Sheets and Excel. I recommend a small edit. Add a variable settings.send_load = {Send, Load} to the settings sheet and refer to it in the Hot Keys sheet V3.

    For the stop loss, it seems it ought to be possible to get StopPrice from something like StopPrice= Price-100/Share where 100 is the amount risked set in your Sheets app. I can't get it to work. Maybe you can. It doesn't seem to be willing or able to set a float (StopPrice) using an int (Share).  Here is the script i was trying. The first part is entirely from your configuration. And I added :

    Share=Pos;ROUTE=STOP;StopType=Market;StopPrice=Price-75/Share;TIF=DAY+;SELL=SEND 

    to get:

    DefShare=BP*0.5; StopPrice=Price; Price = Ask - Price + 0.01;SShare = 75 / Price;Share = DefShare - SShare; DefShare = DefShare + SShare; SShare = Share; SShare = DefShare - SShare; Share = 0.5 * SShare; TogSShare; ROUTE =SMRTL; Price = Ask +  0.05; TIF=DAY+; BUY=Send; DefShare = 500;Share=Pos;ROUTE=STOP;StopType=Market;StopPrice=Price-75/Share;TIF=DAY+;SELL=SEND 
     

    Note that it does create both orders if I use StopPrice = Price - .15

    But of course, .15 is just arbitrary.

     

    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.


  19. 1 hour ago, Jmos said:

    Thanks! I had that script correct, but didn't realize you needed to have the montage selected  and not the chart/market viewer.

     

    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.

     

    • Thanks 2

  20. 14 hours ago, KyleK29 said:

    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. 

    @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.

    • Thanks 1

  21. On 10/24/2018 at 8:40 PM, Robert H said:

    @KyleK29 I am amazed by how much effort you've put into this solution. Thank you on behalf of the entire Bear Bull Traders Team!

    Would it be possible to automatically send a STOP MARKET order along with the buy/sell execution? The following script only sends a STOP with some arbitrary price relative to Average Cost:

    Share=Pos;ROUTE=STOP;StopType=Market;StopPrice=AvgCost-0.10;TIF=DAY+;SELL=SEND

    How cool would it be to double-click your stop level, automatically calculate share size, send the order, and send a stop order with the press of one hotkey. Thanks!

    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. 

    • Like 2
    • Thanks 1
×
×
  • 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.