Jump to content

Day-Meister

Lifetime Members
  • Content Count

    18
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Day-Meister


  1. I did have a request for a version of this script that entered the trade and made a single order at 1R for 12.5% of position and the remainder at 3R.

    This is what I came up with (Long version based on BP only)

    CXL ALLSYMB; StopPrice=Price-0.01;DefShare=BP*0.5;Share=DefShare*0.333*Price*0.01;Price=Ask-Price+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/8;Share=Share*8;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=1000;Price=Ask-StopPrice+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.125 TIF:DAY+;Price=Ask-StopPrice*3+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.875 TIF:DAY+;

     


  2. On 11/22/2022 at 5:57 PM, TonyKozina said:

    Hey! I tried this script today. But i had no luck with the take profits and stop loss orders. They never showed up in my order window and didnt execute. Pretty much just the incial order worked. 

    Any idea why?

    Usually if the orders aren't showing up you have some type of syntax error in the script.

    I would test it first by re-copying the working script from this thread and paste it as-is in a new botton or hot-key.

    Can't say for sure what else it may be; I know a lot of people are using it wothout issue.


  3. On 11/12/2022 at 10:29 AM, RealEstateDayTrader said:

    @Day-Meister Howdy Day Meister, Just sim-trading with your code for placing multiple range orders L and S.  Love the idea. 

    After using the code for a bit, running an order and closing them on the range, I am seeing sort of ghost displays of range order on the chart as I move up say the stop to close out the position.  I assume this is because DAS is getting loaded with all of these trigger orders or something.   Not affecting the trade, just an observation.

     What's your experience been using this over the last few months?  Is it your goto or no longer using?

     

    No idea why you would see ghost orders. I've never seen it or heard anyone else mention it.

    To answer your question, I actually don't use this anymore. I have a different trading style now that doesn't lend itself to set levels, but more to do with momentum.

    I still use Kyle's keys to enter the trade and set my stop loss, but my exits are based more on observation and using Heikin Ashi Candlesticks

     


  4. 5 minutes ago, paqueuc said:

    Hello,

    Your Hotkey works great, thanks @Day-Meister.

    I would like to adapt it to my needs = 3 TP instead of 4.

    1  TP at 3R

    1 TP at 4R

    1 TP manual for the rest.

    10$ risk trade.

    I wrote this  :

    Long

    
    CXL ALLSYMB; StopPrice=Price-0.01;DefShare=BP*0.97;Price=Ask-Price+0.01;SShare=10/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/3;Share=Share*3;TogSShare;ROUTE=LIMIT;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=1000;Price=Ask-StopPrice*3+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.3 TIF:DAY+;Price=Ask-StopPrice*4+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.3 TIF:DAY+;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos*.3 TIF:DAY+;

    Short

    
    CXL ALLSYMB; StopPrice=Price+0.01;DefShare=BP*.97;Price=Price-Bid+0.01;SShare=10/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/3;Share=Share*3;TogSShare;ROUTE=LIMIT;Price= bid-0.05;TIF=DAY+;SELL=Send;DefShare=1000;Price=StopPrice-Bid*3;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*.3 TIF:DAY+;Price=StopPrice-Bid*4;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*.3 TIF:DAY+;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.3 ACT:BUY STOPPRICE:StopPrice QTY:Pos*.3 TIF:DAY+;

    The trouble is that it creates orders with quantities that are not equals on the entry and the exit.

    Example :

    It buys 48 shares (entry)

    and it creates 3 orders (exit) with 15 shares each.

    On the exit side, I have 15 shares X 3 orders = 45 shares. So when the stop loss is hit, there is still 3 shares in open positions.

    Sorry, I tweaked it a bit but didn't manage to find the trick yet. Could you help me, please ?

    Thanks a lot.

    Best,

    Pierre

     

    Your issue is that your sizes for your orders are set to .3 of your position (.9 total). you could try .333 or go .3, .3, .4 or some such.

     


  5. 2 minutes ago, Miah said:

    Just found this, wow! So many people asking for Kyle's to set range orders and here you are with it all figured out, nice work! 

    It would be great if there was an easy way to move all of the stops to breakeven after the first target is hit, any ideas?

    Glad some people are finding this helpful.

    The move to breakeven is not really doable (although often asked about)
    - You could alter the code to set stop to purchase price at the time you create the orders, but then it would likely get triggered as a stop almost immediately.
    - The ability to alter existing orders from the first triggered order really isn't there as far as I can tell.
    - The best alternative I could think of but am not inclined to pursue at this time would be for the script included in the first range order that would contain a trigger order that cancels all other orders for that symbol and recreates them with the new stop at B/E. If you want to figure that one out, have fun.

    • In essence, you would only create 2 orders initially;
      • one for the first range (including stop) for whatever percentage of your position + a stop for the remaining shares
      • and the first order would need a trigger that cancels existing orders and creating new orders/stops with a new stop price of your average cost.
      • It would need to extrapolate your next profit level somehow based on what that trade was at.
      • There just seems to be too many variables to easily do that.
      • If I ever get bored, I might go back to this and see if I can flesh that out, but since I don't really have use for it, don't hold your breath 🙂

    anyhoo...

    Cheers and happy trading.

     

    • Like 2

  6. 1 minute ago, paqueuc said:

    Thanks @Day-Meister and @peterB,

    I'm currently in the Peak Capital Trading demo DAS account. I don't know the BP set on this account. But with Day-Meister's explanation, I got a key that I didn't see before. I'll give it a try.

    If we are willing to risk a maximum of 1% per trade and dealing with a maximum of 2 trades at the same time, do we need to take this extra caution of reducing our BP by 50 % ? What's the real motivation of doing this ?

    Before DAS, I was using TWS with IB and never got a margin problem on my live account when I was risking 1% of my account on a single trade. I could even run 2 or 3 trades at the same time without issue. But I don't know how DAS manages - interact with the IB buying power...

    Thanks for your thoughts on this.

    This gives maximum flexibility over a variety of stocks trading at varying price levels. Basically, your BP is fixed and is based on what DAS has calculated. so BP *.5 allows you to enter 2 trades at the same time using a total of your Max BP. The issue you have run up against is that your risk level is so narrow on this price of stock that it is not giving you full risk $, but using the full amount of buying power you have elected to use per trade. (for example: If I have a micro account with BP of $100 and want to risk all of it on a stock that is trading at $50, it doesn't matter where I put my Stop, I can't buy more than 2 shares)
     

    As for DAS, you should see what DAS has calculated as your buying power in your account window. You should also be able to see BP withheld in your positions window.

    Hope that makes sense.


  7. 17 minutes ago, paqueuc said:

    Hi @Day-Meister,

    Thanks for your script, it works nearly great.

    I chose the following one (short - $ risk / trade) where I replace the value 50 by 300 in order to have a $ 300 risk trade (capital 100 K)

    When I replace the value 50 by 100, it works perfectly. I get the good amount of shares so that my total risk = $100. Perfect.

    But in the script above, when I replace 50 by 300, I don't get a $300 risk. Even stranger, I made 3 trades on AAPL as a test tonight and I got the exact same amount of shares (344) opened, regardless the size of the risk.

    Example 1 : entry = 145.16 / stop loss = 145.53 => risk = $0.37 / number of shares = 344 / total risk = $127.28

    Example 2 : entry = 145.11 / stop loss = 145.2 => risk = $0.09 / number of shares = 344 / total risk = $30.96

    Example 3 : entry = 145.32 / stop loss = 145.74 => risk = $0.42 / number of shares = 344 / total risk = $144.48

    Did I do something wrong ?

    Thanks for your help.

    Best,

    Pierre

     

    What I think is happening is you don't have enough buying power for it to purchase a full $300 risk.

    If it is a margin account and you have $100k available BP, the script is designed to use half of that amount: "DefShare=BP*0.5", so $50K

    344 shares * $145 = $49,880

    So, although you narrowed your stop loss vs. the purchase price, you couldn't achieve more than your total def shares as above. If you want to test that theory, you can change the "DefShare=BP*0.5" to "DefShare=BP*0.75" and see if that changes the amount of shares it takes.


  8. On 3/14/2022 at 8:35 PM, Fernando Samora said:

    Hey all! Amazing script thank you so much might help me a lot. I tend to exit my position sooner than I should. 

    Anyone tried it with a fixed $ risk amount? Once 2R hits does the stop loss gets updated with the remaining shares.

     

    Also I've noticed that when the STOP Loss hits it doesn't cancel the order target orders. Anyone found a way to fix this? 

     

    EDIT: Is there a way to do the following: (1) Have my stop-loss updated with the new position if it hits one of the profit targets? 2) once both profit targets hit have that order removed? (3) if any of the profit targets hit have the stoploss moved to the breakeven range? 

    Thanks!! @KyleK29  @Day-Meister

    Hey Fernando,

    - The Stop Loss for the remaining orders can not be updated automatically based on the automated profit taking as it is all set in one motion when you enter the trade. I don't know of anyway to carry your cost variable forward and have it re-write the orders based on the first (or any subsequent) fill.

    - There are examples of this script with fixed $ in the thread

    - If it is set up correctly, all orders should be set as range orders, therefore as soon as one condition is met (a specific target is achieved), the entire portion of that order will be complete leaving you with the remaining orders (or none in the case of stop loss). There should not be a state where one of the conditions of the range order is hit and executed but leaving the other side of the range intact.

    - If all your profit targets are hit, you should be left with 1 outstanding stop loss order for 1/4 of your original share size; This is by design in order to let you manually ride the trend until you decide to exit.

     

    I hope that answers your question.


  9. 3 minutes ago, jokajon00 said:

    @Day-Meister Thanks so much! This is awesome; tested it in simulator. I adjusted it for $Fixed risk and also other Rs (just need the orders in and then I can slide em where I need on the chart) it seems to work. Just want to make sure its right or if anyone else needs it that its here This is for a short entry with a $20 Risk. I changed routes to my preferred routes and also because my broker doesn't use SMRTL (ILIMIT is what they use and I've seen some brokers use in Kyles excel file). Here's what I've got:

     

    
    CXL ALLSYMB; StopPrice=Price+0.01;DefShare=BP*0.5;Price=Price-Bid+0.01;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/4;Share=Share*4;TogSShare;ROUTE=LIMIT;Price= bid-0.05;TIF=DAY+;SELL=Send;DefShare=1000;
    Price=StopPrice-Bid*2;Price=Bid-Price; TriggerOrder=RT:NSDQL PX:Price ACT:BUY QTY:POS*.25 TIF:DAY+;
    Price=StopPrice-Bid*3;Price=Bid-Price; TriggerOrder=RT:NSDQL PX:Price ACT:BUY QTY:POS*.25 TIF:DAY+;
    Price=StopPrice-Bid*4;Price=Bid-Price; TriggerOrder=RT:NSDQL PX:Price ACT:BUY QTY:POS*.25 TIF:DAY+;
    Price=StopPrice-Bid*5;Price=Bid-Price; TriggerOrder=RT:NSDQL PX:Price ACT:BUY QTY:POS*.25 TIF:DAY+;
    TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.3 ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY+;
    

    And for SSR gets changed to: ROUTE=LIMIT;Price= bid+0.01;TIF=DAY+;SELL=Send;DefShare=1000;

     

    And Long will be:

    
    CXL ALLSYMB; StopPrice=Price-0.01;DefShare=BP*0.5;Price=Ask-Price+0.01;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/4;Share=Share*4;TogSShare;ROUTE=LIMIT;Price= Ask+0.03;TIF=DAY+;BUY=Send;DefShare=1000
    Price=Ask-StopPrice*2+Ask;TriggerOrder=RT:NSDQL PX:Price ACT:SELL QTY:POS*.25 TIF:DAY+;
    Price=Ask-StopPrice*3+Ask;TriggerOrder=RT:NSDQL PX:Price ACT:SELL QTY:POS*.25 TIF:DAY+;
    Price=Ask-StopPrice*4+Ask;TriggerOrder=RT:NSDQL PX:Price ACT:SELL QTY:POS*.25 TIF:DAY+;
    Price=Ask-StopPrice*5+Ask;TriggerOrder=RT:NSDQL PX:Price ACT:SELL QTY:POS*.25 TIF:DAY+;
    TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

    This is definitely a life saver. Work smarter, not harder! Thanks again!

    Excellent! Glad you got something that works for you!


  10. 1 hour ago, jokajon00 said:

    @Day-Meister Yeh. I just cant figure out the code for 4 limit orders and 1 stop order to be triggered after entry . I will be at the trade desk so don't need the stop to change automatically. Once a limit order hits I can just load the Stop Order into the montage by double clicking it, then click P to change to current position size and then click RPL to replace and change it. If you could post the code for 4 covers and 1 stop order that'd be awesome.

     

    Thanks again.

    OK, Try this for long:

    CXL ALLSYMB; StopPrice=Price-0.01;DefShare=BP*0.5;Share=DefShare*0.333*Price*0.01;Price=Ask-Price+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/4;Share=Share*4;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=1000;
    Price=Ask-StopPrice*1.5 +Ask;TriggerOrder=RT:SMRTL; Price=Round2; PX:Price ACT:SELL QTY:POS*.25 TIF:DAY+;
    Price=Ask-StopPrice*2+Ask;TriggerOrder=RT:SMRTL PX:Price ACT:SELL QTY:POS*.25 TIF:DAY+;
    Price=Ask-StopPrice*3+Ask;TriggerOrder=RT:SMRTL PX:Price ACT:SELL QTY:POS*.25 TIF:DAY+;
    Price=Ask-StopPrice*4+Ask;TriggerOrder=RT:SMRTL PX:Price ACT:SELL QTY:POS*.25 TIF:DAY+;
    TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

    and this for short:

    CXL ALLSYMB; StopPrice=Price+0.01;DefShare=BP*0.5;Share=DefShare*0.333*Price*0.01;Price=Price-Bid+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/4;Share=Share*4;TogSShare;ROUTE=SMRTL;Price= bid-0.05;TIF=DAY+;SELL=Send;DefShare=1000;
    Price=StopPrice-Bid*1.5;Price=Bid-Price; Price=Round2;TriggerOrder=RT:SMRTL PX:Price ACT:BUY QTY:POS*.25 TIF:DAY+;
    Price=StopPrice-Bid*2;Price=Bid-Price; TriggerOrder=RT:SMRTL PX:Price ACT:BUY QTY:POS*.25 TIF:DAY+;
    Price=StopPrice-Bid*3;Price=Bid-Price; TriggerOrder=RT:SMRTL PX:Price ACT:BUY QTY:POS*.25 TIF:DAY+;
    Price=StopPrice-Bid*4;Price=Bid-Price; TriggerOrder=RT:SMRTL PX:Price ACT:BUY QTY:POS*.25 TIF:DAY+;
    TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.3 ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

    That is for sizing based on BP

    Replace the first line of each with the corresponding code for $fixed risk from above.

    In testing, I noticed that sometimes it would only create 3 orders (I suspect it has something to do with calculation of the 1.5R) (EDIT: pretty sure that was the issue; corrected script with ROUND2 to hopefully fix that)


  11. 18 hours ago, jokajon00 said:

    Awesome this works great. @Day-Meister Is there a way to adjust code so there is 1 stop order for the entire position and 4 cover or sell orders for 25% each at 1.5R, 2R, 3R, 4R?

    Just want to see if I can get some ECN rebates haha ROUTE would be NSDQL or smart limit.

    Thanks a million!

    It sounds simple in theory, and you could adjust the code to create the initial orders that way by making them 4 different limit orders and 1 stop order (rather than the multiple range orders); The problem comes when your limit orders are hit, there is no way to really change the quantity of your stop order automatically. I can't think of a way to overcome that, sorry.


  12. On 2/13/2022 at 2:34 PM, Warren J said:

    Kevin, I really like this post.  For some stupid reason, I have not been able to get my hotkeys made for taking profit.

    Would you be willing to share the scripts for the other keys.  What I am looking for is to be able to get into a trade and preset my profits at 1R, 2R and R at the same time.

    Thanks,

    WarrenJ

    I think this is what you are looking for: 

     


  13. 29 minutes ago, Quy Doan said:

    That works perfect for both Long and Short. 

    Thank you so much for your help.

     

    Just curious: what is "DefShare=BP*0.5" mean on the code. Does it mean the execution only take 50% the buying power to get the share size?

     

    Awesome. Yes, the DefShare=BP*0.5 uses half buying power. This seems necessary for trading stocks that may not allow as much leverage as DAS has calculated. (This is necessary for me at least; Feel free to experiment with that value if you want. It may not be necessary with the $ value defined risk vs. the Buying power one, but it is included in Kyle's hotkeys so I assume it is still valid)


  14. 8 hours ago, Quy Doan said:

    Thank you for the amazing work @Day-Meister

    Can I use the scripts to enter a long or short with a fixed dollar risk $50/trade?

    OK,

    This should give you $50 long risk:

    Quote

    CXL ALLSYMB; StopPrice=Price-0.01;DefShare=BP*0.5;Price=Ask-Price+0.01;SShare=50/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/4;Share=Share*4;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=1000;Price=Ask-StopPrice*2+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.25 TIF:DAY+;Price=Ask-StopPrice*3+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.25 TIF:DAY+;Price=Ask-StopPrice*4+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.25 TIF:DAY+;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos*.25 TIF:DAY+;

    and $50 short risk

    Quote

    CXL ALLSYMB; StopPrice=Price+0.01;DefShare=BP*0.5;Price=Price-Bid+0.01;SShare=50/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/4;Share=Share*4;TogSShare;ROUTE=SMRTL;Price= bid-0.05;TIF=DAY+;SELL=Send;DefShare=1000;Price=StopPrice-Bid*2;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*.25 TIF:DAY+;Price=StopPrice-Bid*3;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*.25 TIF:DAY+;Price=StopPrice-Bid*4;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*.25 TIF:DAY+;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.3 ACT:BUY STOPPRICE:StopPrice QTY:Pos*.25 TIF:DAY+;

     

    Obviously test in SIM extensively before counting on it 🙂

    Let me know how it goes

    • Like 1

  15. 2 minutes ago, Alastair said:

    Not sure if the following info would help, but understand version....16, currently in beta can cancel just the STOPS only.

    Then would need to figure how to put each back at the AVGCOST.

    Jus my 2 cents.

     

    Interesting. I wonder if that will work for stops that were set as part of a range order rather than the whole range.


  16. On 1/31/2022 at 10:30 AM, TJ said:

    This is awesome and exactly what I've been looking for!  I tried setting target limit orders, which has worked ok, but having it all in one hot key is a game changer.  Any idea if it is possible to have the order move the stop to b/e after the first partial is taken?  I'll see if I can script it, but just thought I would ask the professional first.  Thanks again!  

    This should be possible, but very clunky. 1 way would be to have a nested trigger (if that is possible) within the 1st partial trigger that cancels all the others and recreates them with the new Stop value.

    If you attempted a second script after this one completed, you wouldn't be able to capture what you determined your initial risk was, so your limit orders wouldn't be put in the right spots. Personally, I just drag my stops to manually identified levels (pivots, support/resistance) afterwards as I manage the trade.

    6 hours ago, Quy Doan said:

    Thank you for the amazing work @Day-Meister

    Can I use the scripts to enter a long or short with a fixed dollar risk $50/trade?

    This should be easy enough by substituting the calculation in the first part of the script. My heads not in it today, but I will take a look at it and see if I can do, it test it, and post it in the next few days.

     


  17. I have been working today on 2 hotkeys for myself.

    The script(s) uses the defined R/R script from previous Kyles hotkeys.

    It performs the following:

    • Cancels any previous orders for the symbol
    • Enters the trade, ensuring total shares bought is equally divisible by 4 (rounded down); this prevents having extra shares hanging around after the range trades complete or stop out.
    • Creates a range order at your stop level for 1/4 of your initial shares bought with a profit level of 2R
    • Creates a range order at your stop level for 1/4 of your initial shares bought with a profit level of 3R
    • Creates a range order at your stop level for 1/4 of your initial shares bought with a profit level of 4R
    • Creates a single order at your stop for the remaining 1/4 shares; This allows you to ride the last 1/4 to whatever level you want before exiting

    As with Kyles hot key scripts, you double click your chart at the level you want to place your stop then press your button or hot key

    The Script for the long entry

    CXL ALLSYMB; StopPrice=Price-0.01;DefShare=BP*0.5;Share=DefShare*0.333*Price*0.01;Price=Ask-Price+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/4;Share=Share*4;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=1000;Price=Ask-StopPrice*2+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.25 TIF:DAY+;Price=Ask-StopPrice*3+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.25 TIF:DAY+;Price=Ask-StopPrice*4+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.25 TIF:DAY+;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos*.25 TIF:DAY+;

    and the Short

    CXL ALLSYMB; StopPrice=Price+0.01;DefShare=BP*0.5;Share=DefShare*0.333*Price*0.01;Price=Price-Bid+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/4;Share=Share*4;TogSShare;ROUTE=SMRTL;Price= bid-0.05;TIF=DAY+;SELL=Send;DefShare=1000;Price=StopPrice-Bid*2;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*.25 TIF:DAY+;Price=StopPrice-Bid*3;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*.25 TIF:DAY+;Price=StopPrice-Bid*4;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*.25 TIF:DAY+;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.3 ACT:BUY STOPPRICE:StopPrice QTY:Pos*.25 TIF:DAY+;

    Long $50 Risk

    CXL ALLSYMB; StopPrice=Price-0.01;DefShare=BP*0.5;Price=Ask-Price+0.01;SShare=50/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/4;Share=Share*4;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=1000;Price=Ask-StopPrice*2+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.25 TIF:DAY+;Price=Ask-StopPrice*3+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.25 TIF:DAY+;Price=Ask-StopPrice*4+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:POS*.25 TIF:DAY+;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos*.25 TIF:DAY+;

    Short $50 Risk

    CXL ALLSYMB; StopPrice=Price+0.01;DefShare=BP*0.5;Price=Price-Bid+0.01;SShare=50/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;Share=Share/4;Share=Share*4;TogSShare;ROUTE=SMRTL;Price= bid-0.05;TIF=DAY+;SELL=Send;DefShare=1000;Price=StopPrice-Bid*2;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*.25 TIF:DAY+;Price=StopPrice-Bid*3;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*.25 TIF:DAY+;Price=StopPrice-Bid*4;Price=Bid-Price;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:Price HighPrice:StopPrice ACT:BUY QTY:POS*.25 TIF:DAY+;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.3 ACT:BUY STOPPRICE:StopPrice QTY:Pos*.25 TIF:DAY+;

     

    Everything prior to defshare=1000 in each script is completely from the original Risk/Reward Hotkeys except the bit of code that ensures the number of shares is equally divisible by 4.

     

    Feel free to give them a try and let me know if there are any issues.

     

    2022-02-09_8-00-24.png.fc29d7a6e725ff5965eccf7aac5adbc4.png

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