Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 08/27/2022 in all areas

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