Jump to content

KyleK29

Lifetime Members
  • Content Count

    272
  • Joined

  • Last visited

  • Days Won

    48

Posts posted by KyleK29


  1. On 10/28/2018 at 7:08 PM, Michael P said:

    Possible problem. I don't think the SShare variable works as an unsigned int.

    This script

    SShare=256; Share = SShare-300

    Sets the display to 256 and Share to -44 (as expected)

    But this script:

    SShare=-256; Share = SShare-300

    Unsets the display and sets the Share as -300, and evidently, 'SShare = -256' results in SShare equal to 0.

    If you are using: 'SShare = Share' to function like  'ABS(Share)', I think it will fail when Share < 0

     

    Also important, the scripts are too long to use in the button hot keys. They work in the hot key file when assigned to a keyboard shortcut, but the buttons' text boxes, that holds the script, are limited to 200 characters.If you paste a 300 character script, only the first 200 characters are saved in the text box.
     

     


     

     

    I'll look into the problem. Did you notice this by manually doing hotkeys with SShare = -256; SShare - 300 or was it during an actual order operation? I noticed this exact behavior when developing the hotkey and worked around it in how I formatted the order that it calculates in.  I'd have to look at my notes, but if I recall, display (SShare) behaves as an unsigned INT when it's being transferred from Share (it loses the sign), this is because Share swaps from -300 to 300- on box refresh (you'll notice this when going short). However, oddly, manually setting SShare to a negative INT will cause the Display Box to show 0. The typed explanation of how the script works is a simplified version - to develop this I flowcharted all of the memory containers so I could properly "see" what I needed to do, I just didn't feel like typing up a really detailed explanation.

    As for the hotkey button limitation, there's no real solution for that. This is a very hack-like way of doing what is normally a very simple string of operations because of limitations in DAS. I hope that someday they give proper script support with some user variables and functions that we can do this properly. The entire command would be a lot smaller with a few built-ins.

    Also, I'll look into making the Google Sheet a tad more Excel friendly with your suggestions. 


  2. On 10/12/2018 at 12:11 PM, TonyC said:

    Great script!

    I've been looking for information on the user defined variables but can't seem to find any. Do you know if it's possible to define variables for price?  Basically, instead of a b/e hotkey, i wanted to create one that allows to keep half/quarter of your winnings.

    For easy math, say you went short at $100 per share, the current price is at $90. You want to let it run buy want to protect at least half of your current winnings.. to do so, you need a stop order @ $95. If the DAS scripting allowed for parentheses, you could just do StopPrice=AvgCost+((AvgCost-Bid)*.5) which would equal StopPrice=$95; $100+(($100-$90)*.5)=$95

    If I could define 2 variables I could do: DefVar1=AvgCost-Bid; DefVar2=DefVar1*.5; StopPrice=AvgCost+DefVar2;

    However, I can't seem to get the variable definitions to work, any thoughts?

    Thanks.

     

    From what I can tell, the user can't assign/create variables. The way I did the one in this thread was to use available variables that the user can access via the hotkey / montage. These can change depending on what ROUTE is selected.

    SSHARE --> Display Box (next to share), this is an unsigned INT, read/write
    SHARE --> Share Box, this is an INT, read/write
    PRICE --> Price Box, this is a FLOAT, read/write
    DEFSHARE --> Default Shares (not displayed, but accessible), this is an INT, read/write
    TRAILPRICE --> Trailing Price, FLOAT, but only available if STOP is selected and stop type = Trailing, read/write
    STOPPRICE --> Trigger Price, FLOAT, only available if STOP is selected and "trigger price" box is writeable, read/write
    CAPSHARE --> String, write only
    PREF --> String, write only.

     

    Because prices are floats and the majority of variables available are INT based, you can always convert a float to an INT by multiplying by 100 and then dividing by 100 later (to get it back to float), otherwise moving a FLOAT to an INT variable will drop the decimal portion ($100.99 becomes $100). For your request, if I'm understanding it correctly, you don't need to do too much. 

    See if this works, it's hard to test these as you have to get a stock to move to really see it. Again, SIM or a test symbol for trying it out.

     

    
    SHORT:
    Share = Pos; Price = AvgCost - Bid * .5; Price = AvgCost - Price; Route=STOP;StopType=Market;StopPrice=Price; BUY
    
    LONG:
    Share = Pos; Price = Ask - AvgCost * .5; Price = AvgCost + Price; Route=STOP;StopType=Market;StopPrice=Price; SELL
    

    What it's doing is:
    Short Entry Price: $100
    Current Bid: $90

    Share = Pos (our current position)
    Price = AvgCost - Bid * .5 ---> $100 - $90 * .5 ---> $10 * .5 = $5 (Note: DAS calculates in the order seen, I believe), "Price" is our temporary calculation of the midpoint (* .5).
    Price = AvgCost - Price --> $100
    The rest is just a standard STOP order.

    From what I tested, this worked for finding the midpoint and setting stop midway between the current value. Unfortunately, the hotkey commands for REPLACE (replace an existing order) don't seem to work correctly for STOP order types, so if the stock continued to move in your favor, you'd need to cancel the current STOP and then set the new one (rerun the hotkey).

    • Like 2

  3. On 10/3/2018 at 3:40 AM, George C said:

    How do you guys manage your trades? How far away is your stop loss (usually) ? (also what is your accuracy?)

    Thanks,

    G

    When you scale out at a .10c move, are you moving your stop (physical or mental) to break even? I ask because I changed scale-out strategies in August (SIM based) and took a huge hit (30% winrate, -$4000 on the month). I wanted to "let the runners run" and wait until it got near my price target. I was able to review the data at the end of August and noticed what was going on (what wasn't working). Like you, my numbers showed that my avg loser was way bigger than my avg winner, per trade expectancy was negative. I think the biggest (good) changes were the scale-out and the risk-based share sizing.

    Obviously, each person needs to develop their own strategy, but my current strategy is this:

    1) Risk Based Share Sizing (see dynamic calculator in DAS area of forum) factored for confidence (e.g. if I'm not confident, I use smaller size than my max-risk allowable). My share size is based upon the stop distance.
    2) When the stock reaches 1R (if my stop distance is $0.13 away, it'd need to move in my favor $0.13), I sell 25% and move my mental stop to break-even. I repurposed the Fibonacci tool (since I don't use it) to be a 1R, 2R, 3R levels indicator.
    3) During the trade, I scale out some more where I see resistance forming or near known resistance levels (moving averages, half dollar, whole dollar), or at 2R, 3R, or the price target. Using my sell 25% hotkey.
    4) My mental stop tends to float, so if a moving average that has been respected recently (bounced off of) is above my break-even point, I'll watch it as an indication for a change of direction (it can go past it a little bit to allow variance) and use that as a trailing stop.
    5) Once my shares get down below 100, I usually measure the last two pullback distances, add a few cents to it (as long as it doesn't place it below the break-even point), and set it as a trailing stop order. Move on to the next trade.

    What really helped me refine this to my personality was a few data points that I record with every trade:
    - Highest Price in Trade (this is price related, not direction related, so highest price seen for either long or short)
    - Lowest Price in Trade

    Those aren't prices you executed at, but prices that the stock reached while your trade was open. From there, I can calculate the average R-movement, updraw%, and downdraw% for every trade. When I reviewed August's losses, the data told me that: 78% of my picks moved in my favor. I was simply not scaling appropriately and letting winners run against me. My position sizing and $risk was all over the place.

    For September, I implemented the new strategy listed above. Winrate is 76%. It has a lot of "small" wins.

     

    I'm working on releasing a few custom tools to the community to help people narrow down their strategy and refine their edge. One is a data-focused journal (does most of the work for you) and the other is a backtester (allowing you to automatically replay all of your trades with different scale out approaches you want to test).

     

    • Like 3

  4. Not sure if this is the right forum for this as I couldn't find one where it "fit" the criteria perfectly, so move it as needed.

    In the documents linked below is an example trading plan that I created many months ago from various sources, as well as my own thoughts. I've developed many business plans in a similar fashion and the way I get the most done is by typing up a list of questions, printing it out, and writing (or typing) thorough answers to those questions. You then wait a few days (reset your mind) and return, putting those answers into concise statements / paragraphs to form the basis of your overall business plan. 

    For a trading plan, you may never do the second part (putting it into concise paragraphs), that's OK. The intended purpose of a plan (for business or trading) is to make you think and develop a vision for what you feel is success and how you intend to go about reaching your goal. Just like a business plan, you may deviate from it, you may go slower than you projected, and / or you may alter it along the way. It doesn't matter how you use it after you create it, it's just there to put you back on the tracks if you come off or serve as a reminder to the longer term goal if you're having a short term struggle.
     

    Some Tips:

    - I encourage you to really reflect on your answers, get granular with them, the more you get out of your head now is the more you'll be able to power through in the end. My last major business plan I wrote risk-aversion scenarios for coupe d'etat's (it was for the Middle East) and an assortment of what-if's related to the region  - you won't need that here (although, maybe you have terrible in-laws and it's not out of the question), but it helps to think complex (possible) scenarios through as you'll be more prepared to react if it happens.

    - Set realistic goals. I took a few psychology courses on goal setting at university for my degree and they all seem to agree. Break the goal up into small obtainable steps and build momentum. So don't say "I want to be a billionaire in 5 years," reframe it as "In 5 years, I'd like to have my house paid off entirely, and I'm going to do it by ...". A goal too far out of reach or without structure is useless, even if there's a slim chance. 

    The document has questions for the following sections:
    - Introduction --> Just a brief overview of what's intended.
    - Overall Goals & Strategy --> Questions regarding your intended trading goals and strategy.
    - Education / Evolution --> Questions about how you're going to gain knowledge and evolve to meet your goals.
    - Psychology --> Questions for how you plan to deal with the psychological aspects of trading.
    - Timeline --> Your intended timeline of milestones. How you plan to progress through it.
    - Future You Statements --> Prejourney Statement (message to yourself to be read after you've completed the journey, written in the future-sense like you're talking back at yourself.)
    - Time Statements --> Done at certain intervals, a quick journal of your progress so far. 
    - After Completion Statements --> Area for you to reflect after this leg of the journey is over and you're about to start the next.
     

    Documents:

    Template File (with example data): https://drive.google.com/file/d/1hKLkaPc4pYXNIpjv26ud3pFLWbeBogvL/view?usp=sharing
    Template File (blank, just questions): https://drive.google.com/file/d/14VL_ZVk1gBgqpKNeYwiNJDYwfWfSF2gS/view?usp=sharing
     

    • Like 2
    • Thanks 3

  5. On 10/3/2018 at 5:41 PM, Seamus said:

    Kyle. 

    Appreciate the reply and quick dive on your part into Genovation. I believe that yes, installs are complete. I understand the hotkey creation in DAS without any real issue, so I believe I’ve the handle on basic practice. I’m stuck on what I’d call mapping or quite possibly, I don’t fully understand the Genovation (external keypad) concept. 

    A conventional “buy now at +.05” assigned to F1 makes sense. The Geno keypad doesn’t have an F1 and for the matter, it doesn’t appear any key is fixed to the system. I also cannot locate a cell or placement in the setup Geno software where I would establish say, the top left key is recognized by the system as F1 and thus, maps the command when said Geno button is pressed. I’m pretty certain I am making the situation quite complicated.

    The trading theory currently studied is rather intuitive in my brain, programming...not so much. 

    Thanks again man for the reply. 

    Also, take a look at this thread: 

    Appears there might be an issue with the Windows 10 drivers, so you have to use Flash Drive mode for programming. They'll be able to help a tad more, as they have the device.

     


  6. 13 hours ago, Jason W said:

    I'm not even sure if DAS knows the difference. Because DAS does not separate long BP  and short BP 

    If DAS does not know the difference, then the value should still be 0.25 right ?

    If DAS knows the difference, then 0.3 is fine. 

    There is no way to test this in the SIM, SIM has the same buying and shorting power I think. 

    So I'm gonna have to take one for the team .....   

    Thanks again Kyle. 

    I wouldn't take one for the team  testing it, use a NASDAQ testing symbol. It sends the order in to the market, but they don't actually fulfill with anything (as it's not a real company). These: TEST TESTB TESTE TESTX ATEST

    Additionally, a few different ways to test it to wait until the market closes and switch the "SELL=SEND;" to "SELL=LOAD;", click a price really close to the current. See what it puts in the share box, as that's likely to be the maximum-affordable calculation. That's how I tested a lot of it, with the market closed you don't have to worry about the price jumping around and can consistently click different stop distances (e.g. .10c back, .20c back) to see what it is calculating.

    I assume that DAS is likely using the buying power for long for both calculations (since it doesn't know you're planning to go short when it loads the values), so you'd need to factor that into the hotkey, 0.33 should be the right number on the short side.

    **EDIT**

    I think I may have figured out how to go about this:

    Example Numbers:
    Equity: $25,000
    Buying Power Long 4:1 - $100,000 : $25,000
    Buying Power Short 3:1 - $75,000 : $25,000

    Assuming $10 stock and that DAS is going to use the LONG number for both:
    BP = 100,000 / $10 = 10,000 "Shares"
    10,000 * 0.25 [equity] = 2,500 [at account equity]


    BP * 0.75 = 75,000 / $10 = 7,500 "Shares"
    7,500 Shares * 0.33 [equity] = 2,475

     

    So try this:
     

    DefShare=BP*0.73; Share=DefShare*0.333333333333333* Price * 0.01;

    That opening DefShare=BP*0.73 is saying "Calculate using 73% of Buying Power [assuming it's using the LONG number]" (It's 75% minus 2% for a buffer for price fluctuations/spreads).
     

    Please let me know if you test it and if it works or not. If it does, I'll add it to the configuration and instructions.

    • Like 1

  7. --------------------------------------------------------

    Figured I'd post these here and not make a new thread. A lot of these icons were custom created by me, and a few were royalty-free. The PSD was done quickly, so it's not the easy thing to figure out - I included it, if anyone wants to create their own. If you can think of one that I'm missing, feel free to suggest it and maybe I'll create it. Also attached examples of how I have mine setup.

    Design wise, I tried to coordinate the colors for easy recognition.

    ICON PACK

    _img_explorer_2018-10-10_18-54-03.thumb.png.d34173545989dee7c4494d43be2fa366.png

     

    Download Here: https://mega.nz/#!798GnASY!dzl8p6cm8CgWPRh67A6-B5lVQv-Ru4cDF6cFqwUEl90

    MAIN MENU:
    _img_StreamDeck_2018-10-10_18-54-28.png

    LONG FOLDER:
    _img_StreamDeck_2018-10-10_18-54-49.png


    SHORT FOLDER:
    _img_StreamDeck_2018-10-10_18-54-37.png

    • Thanks 3

  8. On 9/18/2018 at 12:29 PM, klease said:

    Hi all, I'm having trouble with this too... I set the buttons to match the key presses for hotkeys in DASpro but they don't work when I push them.  They do send data though, I confirmed that in notepad. 

    I think it has to do with what was said earlier about setting it to recognize the "DASpro profile settings"  Can anybody elaborate?  Seems to keep coming up but nobody has explained it yet.

    Here's a screenshot of how I do it. You'll notice I have the button mapped to: CTRL+ALT+PgDown (ignore the title of F1, I never changed it). In the Settings > Profiles > I have a "Day Trading" profile configured and Application set to "None." 

    Also note that DAS doesn't appear to support certain key presses (F13 to F24).

    I also uploaded my DayTrading profile here if you want to see it: https://mega.nz/#!Wgl2mA6a!l8cCkSJnh1c7eD6bK6VM2yE5U_DgfAd-9uAs8qEuGvw

    You'd have to unzip the profile and import it.

    2018-10-10_18-41-28.jpg

    • Like 1

  9. On 10/6/2018 at 5:07 PM, jimguo22bbt said:

    This is brilliant. I am going to define my hotkeys using your script template and try it in my simulator (this is my 2nd week in the simulator). 

    I think there is one caveat of the script which I describe below. Please correct me if I am wrong.

    When calculating the number of shares one could afford with current account buying power:(e.g. DefSahre = BP*0.98), your script would be using the "stop loss" price instead of actual bid/ask price. This difference would lead to not having enough buying power when going for a long position with current account buying power. I guess you must have realized that and hence set 98% of total buying power as default. I could not think of an easy way to deal with this issue as we do need the stop loss price in the calculation. But I think this could be listed as "know issues" of the script to warn potential users. 

    (Additional note: DefSahre = BP*0.98: This was confusing to me at first: how could buying power ($) multiple 0.98 is equal to share number?. After I checked the Dastrader manual and realized that it was actually calculating BP*0.98/Price. This was really Dastrader's fault. I share this here in case other users had the same confusion.)

     

    Yes, that's the reason for the 0.98%. I'm sure if you set a really large stop price, you could effectively run out of buying power. And yes, that DAS calculation confused me at first because I didn't realize the BP function was converting to shares.

     

    On 10/7/2018 at 7:57 PM, Jason W said:

    Thanks again for this amazing script.  

     

    I download this sheet as .xlsx on my computer, it needs to ENABLE EDITING to change the value. But after I enable editing, the spreadsheet stop working.  

     

    Is there anyway to fix this ? 

     

    Thank you 

    I haven't tested it in Excel. It's probably messing up on SHEETS Validation functions as they may not be compatible with that of Excel's. 

     

    22 minutes ago, Jason W said:

    Yo IB requires 25% for margin so it 4:1 on long, but 30% for margin on short, so that's 3.33333:1 on short ?

    So if we gonna do a short script with 1% risk  , is this the correct script ?

    DefShare=BP*0.98; Share=DefShare*0.333333333333333* Price * 0.01; Price = Price - Bid + 0.02;SShare = Share / 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 = 500;

                                         

    or is it Share=DefShare*0.3* Price * 0.01 ?

    Thanks again man !!

    Are these numbers set in DAS as well? With that in mind, if DAS does know the your buying power for long is different than short, then it should work. You can use either 0.33333333333 (<--- sheets defaults to 15 places) or 0.33 (33%) or 0.3 (30%). It won't make too big of a difference.

    I haven't thought of having mixed values for long / short. What you could do is either test it in SIM or use one of the test stock symbols, I believe TEST is one of them (it's a dummy symbol for testing things). Let me know what you find out and if it calculates correctly. 


  10. On 10/3/2018 at 5:41 PM, Seamus said:

    Kyle. 

    Appreciate the reply and quick dive on your part into Genovation. I believe that yes, installs are complete. I understand the hotkey creation in DAS without any real issue, so I believe I’ve the handle on basic practice. I’m stuck on what I’d call mapping or quite possibly, I don’t fully understand the Genovation (external keypad) concept. 

    A conventional “buy now at +.05” assigned to F1 makes sense. The Geno keypad doesn’t have an F1 and for the matter, it doesn’t appear any key is fixed to the system. I also cannot locate a cell or placement in the setup Geno software where I would establish say, the top left key is recognized by the system as F1 and thus, maps the command when said Geno button is pressed. I’m pretty certain I am making the situation quite complicated.

    The trading theory currently studied is rather intuitive in my brain, programming...not so much. 

    Thanks again man for the reply. 

    Yeah, I'm not physically familiar with the device, from what I've read about it, it will flash a key-combination to the button (I believe each button can have an A and B mode). That is stored on the devices EEPROM (hardware memory) and then it sends that stored hot-key to the PC via the USB as that key. This way it can be used without driver software (moved to another PC). 

    See the attached screenshot -- From the looks of it, you run the "Genovation MacroMasterCPxx (CP24)" software and then:
    1) Select the key you want to program (#1 on the screen)
    2) Select the level you want (since each key can have two operations stored), #2 in the image.
    3) Select the key combination, in this example I selected SHIFT + CTRL + A (see #3 and #4)
    4) Save the file. I'd imagine you have to flash this file some how, but I don't have the hardware.
    5) The rest is done in DAS.

    I wouldn't use the F13-F24 keys as DAS doesn't appear to support them. 

    InkedGenovation_MacroMasterCPxx_(CP24)_MacroMasterCPxx_2018-10-10_18-14-59_LI.jpg


  11. On 9/29/2018 at 11:07 AM, Seamus said:

    Holy smokes. You are super smart sir.

    I'm brand new and struggling to understand the setup of my initial Hotkeys. This provided version of yours is incredible. Thank you.

    Now, if I can only figure out how to program this darn Genovation 24 keypad...but I digress.

    seamus

    Ha, I wouldn't go that far. 

    I don't have experience with the Genovation, but a quick glance ( https://store.genovation.com/programmables/cp24-usbhid.html ) tells me it's writing the hotkey command to the hardware memory (so you don't need the driver once you config it). Have you installed the config software for it? 

    On 9/30/2018 at 10:29 AM, Abiel said:

    Great work @KyleK29 thank you!...

    I´d like to take a look at this version...

    Give me a little while to test it, I've made a few modifications. Right now it's literally just doing this type of operation (in AHK script language):

    IF Active Window = Das Trader Pro
    Send RAYLINE Command
    Left-Mouse Click
    Move Mouse 4px to the right
    Left-Mouse Click
    Double-Click Left Mouse
    Send ORDER Hotkey Command

    I use the RayLine because A) I never use it (so I can assign a RED color to it) and B) it allows you to get the longest line without moving them mouse a lot. The difference in order procedure is that you have to HOVER over where you want to place the stop as it does the double-click for you.

     

    • Like 2

  12. On 9/24/2018 at 8:16 AM, Lee W said:

    Thanks!!

    Also a good idea to go to Tools>Back Up Settings.  It will place a file on your PC desktop.  If you need to restore all of the settings, this makes it simple.

    What I also do (besides that) is to right click the DAS folder  (with it closed) --> Send to ZIP. That way you have a very quick way to restore if the new version doesn't work correctly. From what I can tell, DAS doesn't use the registry or any temp folders on the OS, so it's all self contained to that directory.


  13. For being able to remove the STOP automatically, you can add this to the end of your SELL ALL (or COVER ALL) hotkeys: ; CXL ALLSYMB;  --> That clears any open orders for the selected symbol. I use it on all of mine because there were times where I forgot I set price-orders and exited the position. 

    Example for my SELL ALL (Long) Hotkey:
     

    ;Share=Pos;Price=Bid-.05;TIF=DAY+;SELL=Send;CXL ALLSYMB

    DAS's scripting is very very limited. You *can* make a hotkey that would send  a STOP order at 2% account value, but it's complex. The 2% account value (some have it as 1%, which is what I think Andrew has in the books) is setup dependent. It should be calculated on your stop distance, which changes with every setup (might be .10 back or .30 back).

    Fjmocke has a hotkey here: 

     

    If you see my comments at the bottom, there's a version that uses account risk % (original version uses a $dollar amount). I'm working on a new version that will include the Buying Power offset (e.g. if calculated shares is > than buying power available, use lower value). The commands for are very eye-gouging because of DAS's lack of scripting, so I'm also building a tool for the community to set up their hotkeys via a GUI.

    I hope to have those out shortly and I'll post back here to let you know.

     


  14. On 9/20/2018 at 3:04 PM, JohnG said:

    For some crazy reason this didn't work on my Das installation but I found a way that also works very quickly.

    Right-click on a row in the market viewer and with your other hand tap the 'N' key.  You can very quickly add the number of additional blank rows you need.

    I could not get it to work in DAS version 0.33. I think they may have "fixed" it. 


  15. Been using the new .33 all this week. So far, no issues with the hand. I do still have the jumping global lines, but I'm not sure if that was addressed in this release.

    I'm awaiting the next BETA as it apparently has a new hotkey I want (Rectangle), not sure when it'll release.

     

    One thing I've noticed with this software is it's kinda hard to know if something is a BUG or just an implementation issue (incomplete). I've found a lot of stuff in the different studies that seems to be off, but a lot of it seems like they just never finished putting it in. I've been slowly trickling the bug reports in.

     


  16. Slight tweak to the prior command (I edited it into the post above this), moved TogSShare to before the ROUTE/SEND commands. Reading up on this box, I guess it's for sending a different share quantity than what your actual order quantity is (only certain exchanges support it). Figured it's best to clear it before we send to the exchange.

     

    Some people up above mentioned they'd like it to drop a line to where your "stop" is. I believe I can whip this up with a side program to execute the macro, I'll post if I do so.


  17. On 8/30/2018 at 7:16 PM, fullmoonguru said:

    This script is really great! I saw it in this weeks Bearbull Buzz and traded with it today. I didn't have the problem with insufficient buyong power but I could see that happening. It WOULD be nice if you could set a cap somehow. The best way I found to use it is to draw a line at the stop loss I want as the pattern is setting up & the double-click and hit the hot key when I'm ready. 

    One thing I found a little confusing is that it didn't trade on the double-click, but on the hot key press. 

    It's also worth noting that this script is using the $0.10 window instead of the $0.05 that is in Andrews script for the buttons if you're using those. 

     

    On 8/30/2018 at 4:11 PM, Peter S said:

    Thanks for a really useful way to keep position sizing logical, even in the heat of the moment.  It's a shame that when you've sorted out a trade with a really tight stop it tends to get thrown out for having insufficient buying power.  Is DAS capable of handling the logic of ordering the lesser of two numbers, and is there a member of BBT able and willing to supply the code?

    On 8/29/2018 at 2:15 AM, DC said:

    I’ve been using this script a bit as well and I like it apart from when it doesn’t let me have a 10 cent stoploss because it’s trying to buy more shares than I have BP for 😆 (depending on the stock price of course)

    To answer the question about the +0.1, I’ve noticed that when you double click on the chart (say at 50.05) the price in the montage is set at 50.04, thus adding the 0.1 gives you the original price for your stoploss.

    Re: Over Buying Power

    Not fully tested so USE ONLY IN SIM for the time being, but this might work. Note that we have to do some tomfoolery since DAS doesn't allow actual math on a lot of things, so the roundabout way of doing this is to get around the limitations. I'll explain what's going on down below.

    This should load in the shares based on an equation of 1% of your account value. In DAS Simulator, Buying Power is 4 * account balance, so by default that's 25,000 * 4 = $100,000. If you wanted to risk 1% of account value as Andrew says (as the maximum, you may chose .5%), that'd be $250 dollars risked. 

     

    Buy:

    SShare = BP * 0.25  * 0.01 * Price; Price = Ask-Price + 0.01; Share = SShare / Price;  TogSShare; ROUTE=SMRTL;Price=Ask+0.10;TIF=DAY+; BUY=Send;

    SShare = BP * [reversing the leverage given, so 4:1 is a decimal of 0.25 = 25% of buying power]  * [decimal of your risk percentage, 0.01 = 1%] * Price; Price = Ask-Price + [this is an offset in the initial equation]; Share = SShare / Price; TogSShare; ROUTE=SMRTL;Price=Ask+ [this is the fill-zone you use to make sure you get filled, Andrew uses 0.05 I believe] ;TIF=DAY+; BUY=Send

    Sell:

    SShare = BP * 0.25  * 0.01 * Price; Price = Price-Bid + 0.01; Share = SShare / Price;  TogSShare; ROUTE=SMRTL;Price=Bid-0.10;TIF=DAY+; SELL=Send;

     

    So what's happening (I'll use the Buy example, but applicable to both):

    1) SShare = BP * 0.25  * 0.01 * Price; ---> This is setting a "Share Display" box to equal the BP * 0.25 * 0.01 * Price. It's worth noting that using the BP function (buying power) in DAS is actually divided by symbol price (so BP * 0.25 = $100,000 * 0.25 = $25,000 / PRICE). The 0.01 in this equation is the decimal for 1%. If you wanted to risk 2% of your account value, it'd be 0.02.

    BP = 100,000 / PRICE --> If Stock Price = $10, this would be 10,000 --> 10,000 * 0.25 = 2,500 --> 2,500 * 0.01 [1% risk] = 25 --> 25 * PRICE [$10 for example] = $250 --> $250 is the amount we're willing to risk on this trade.

    Side Notes: A) If you're wanting to do 1% of BUYING POWER, I'd recommend setting the "decimal of account equity" (0.25 up above) to 0.90, as this gives you a math cushion to not get rejected for lack of buying power.
    B) If you want to do a fixed dollar amount, you may need to play around with the ratios a tad. Setting SShare to a fixed price will result in the same issue of not having enough buying power in certain scenarios.

    2)  Price = Ask-Price + 0.01; --> Untouched from the original. It's essentially the Level 1 ASK Price minus the chart-clicked PRICE + 0.01 (offset value). For this example, let's assume we wanted the stock price on ASK was $10.00 and we clicked the chart at $9.95 --> Stop Distance = $0.05

    3)  Share = SShare / Price; --> Instead of the assigning the default 125 / Price (for $125 / Price), we use our stored value of $250 so it becomes $250 / Price. For the $10 example, this would be 250 / stop distance of $0.05 = 5000 shares

    4)  TogSShare; --> This toggles the "Share Display" box that we used to store our temporary value to off, releasing the variable.

    5)  ROUTE=SMRTL;Price=Ask+0.10;TIF=DAY+; BUY=Send; --> Unchanged from the original.

     

     

    Some Gotchas:

    We have to pass from float to int values in memory a few times [DAS wants INT for the display box], this will "lop off" anything after the decimal. e.g. 5.85 becomes 5. So it might not be mathematically exact, but close enough for our purposes.

     

    • Like 1

  18. For the DAS Simulator you usually have to put a $ after the symbol. It's hit or miss though. These are the ones that I've found active:

     

    SPY    SPDR S&P 500
    SPX$    S&P 500
    OEX$    S&P 100
    RUA$    RUSSELL 3000
    RUT$    RUSSELL 2000
    RUI$    RUSSELL 1000
    UTY$    PHLX Utility Sector
    SOX$    PHLX Semiconductor
    OSX$    PHLX Oil Service Sector
    HGX$    PHLX Housing Sector
    XAU$    PHLX Gold/Silver Sector
    TRIN$    NYSE TRIN
    NYA$    NYSE COMPOSITE
    NDX$    NASDAQ-100
    TRAN$    NASDAQ Transportation
    IXTC$    NASDAQ Telecommunications
    OFIN$    NASDAQ Other Finance
    QNET$    NASDAQ Internet
    INSR$    NASDAQ Insurance
    INDS$    NASDAQ Industrial
    IXHC$    NASDAQ Health Care
    IXF$    NASDAQ Financial 100
    IXCO$    NASDAQ Computer
    COMP$    NASDAQ Composite
    NBI$    NASDAQ Biotechnology
    BANK$    NASDAQ Bank
    BKX$    KBW BANK SECTOR
    INDU$    DOW JONES 30 INDUSTRIALS


  19. On 8/27/2018 at 12:38 PM, Esam E. said:

     

    IMG_2.thumb.JPG.8ee71f8ef955d4e7d0037acbef71c174.JPG  

     

     

    We have similar setups with the large monitor. How do you like it?

    I've seriously considered switching to a multi-monitor setup. I find I don't want the 3 charts to the side at all (like I planned). It's easier/more natural for me to turn my head to look at another monitor.

     

     

    Not so much a setup, but I remember I snapped this in the chat a week or so back.

    catception_bbt.thumb.jpg.6c8994d362f6dc2f539a3476767e39fd.jpg

     

    Also, for those thinking of getting a standing desk. Costco in the states has stock of a decent one for $300 (glass top, embedded USB, electronic, preset levels).

    • Like 1
    • Thanks 1

  20. Hi, I'm Kyle .. KyleK29 in the chat. Almost 34 years young. Here's a brief overview of my journey so far ..

    At age 13, I started on an entrepreneurial path doing Web Design work while living in Silicon Valley - my first "company" I guess. That work eventually led to some decent full time positions, a move to Las Vegas, and continued personal growth until I took a jump of faith and left it all for a tech start-up.

    That didn't last long (they rarely do) and I went back to school, juggled college hockey, work, and school to earn my degree in Sports Medicine / Entrepreneurship. While there, I dabbled in a crypto-mining operation before a professor I was helping at a startup competition convinced me to enter another project (A.I. related) of mine - one thing led to another, I won a few regional's, finished as a semi-finalist at nationals, and made a push for the tech start-up dream - a free cereal bar, and nap pods! A few radio interviews, newspaper articles, and VC pitches later, we lost momentum and sit in limbo [no one said this would be easy].

    So not one to sit still (it's a problem), a programming side project related to trading led me to pickup a book I bought years prior - Harvey Walsh, Day Trade for Profit - not a bad book, but it rekindled something I've always wanted to learn.  I read a few other books (including Andrew's), and tried a few other places before landing on BBT. It proved a much better fit for me and I quickly jumped at the lifetime membership.

    With that in mind, you'll likely find me helpful, if not a little optimistic at times. I don't believe that the journey in life is set in stone, it just takes a constant stretching of your comfort zone (rhyming unintentional) and a willingness to accept mistakes as excellent opportunities to learn.

    • Like 1

  21. My last simulator platform was easy, click, set, and forget as far as stops go. All done right on the chart (right click or hotkey). But you would get the stop out on those random outlier prices that sweep the stops. When I switched to DAS, I decided to practice the mental stop. What I'm finding helps is that I'll place a horizontal line where I want my stop to be. If the price hits that line, I close out, no questions. I give a decent slight delay to make sure it's not just a random excursion to a really low price. The only *actual* stop I place into the market is when I move to breakeven (e.g. I've taken profit on a target).

    So far, having that line as a mental trigger has worked.

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