Jump to content

We have moved to Discord. Please click here to join us in the Trading Terminal Discord server.



These forums are read-only.

KyleK29

February 14th, 2022 - Special Webinar: Advanced Hotkeys for Risk Management: Part 2

Recommended Posts

KyleK29

Special Webinar
February 14th, 2022

Topic of the Week
Technology / DAS Trader Pro : Advanced Hotkeys for Risk Management, Part 2
 


Shared Clipboard
Any of the scripts or pasteable items we make during class will be pasted in the code box below for each copy/pasting by you.

WEBINARS link: https://forums.bearbulltraders.com/forum/97-technology-webinars/
TECHNOLOGY PAGE: https://bearbulltraders.com/technology-class/

------------
For the Dynamic Risk hotkey scripts, please see the special "Relevant Links" section below.
------------
CALCULATOR SCRIPTS:

FOR THE CALCULATE Scripts you must have an open position and a valid Stop Price populated in the montage's Stop Price ("Trigger Price") box. For best results, 
reload your current STOP Order by double-clicking it in the Orders window or double-clicking the QTY## portion on the order flag. These scripts will populate the
dollar amount into the Montage's "Price" field. 

# Calculate Return at Double Clicked;
Share=Price*100; Price=AvgCost; SShare=Price*100; Share=Share-SShare;Share=Share;Price=Share/100;Share=Pos;Price=Price*Share;TogSShare;Share=0;


# Calculate Risk of Position;
Price=AvgCost;Share=Price*100;Price=StopPrice;SShare=Price*100;Share=Share-SShare;Share=Share;Price=Share/100;Share=Pos;Price=Price*Share;TogSShare;Share=0;


# Calculate Return PnL;
Price=AvgCost;Share=Price*100;Price=Last;SShare=Price*100;Share=Share-SShare;Share=Share;Price=Share/100;Share=Pos;Price=Price*Share;TogSShare;Share=0;


# Check Available Buying Power;
Price=1; Share=BP; SShare=Share; Share=0;

------------

THOR'S FREEROLL:

Thor's Freeroll, has very specific use cases. Please see Thor's videos / chatroom time to see how he utilizes it.

IBKR Version - Short:
 
CXL ABOVEAVGCOST;StopPrice = Price;Share=Price*100;Price=AvgCost;SShare=Price*100;Share=Share-SShare;Price=Share;Price=Share/100;Share=Pos * Price;Price=StopPrice-Bid;SShare=Share / Price;DefShare=BP*0.97;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;SShare=DefShare-SShare;Share=0.5*SShare; Share=Share*1; Price=Bid-0.05;TogSShare;TIF=DAY;ROUTE=SMRTL;SELL=SEND;DefShare=10; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY;
 
IBKR Version - Long:
 
CXL BELOWAVGCOST;StopPrice = Price;Share=Price*100;Price=AvgCost;SShare=Price*100;Share=Share-SShare;Price=Share;Price=Share/100;Share=Pos * Price;Price=Ask-StopPrice;SShare=Share / Price;DefShare=BP*0.97;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;SShare=DefShare-SShare;Share=0.5*SShare; Share=Share*1; Price=Ask+0.05;TogSShare;TIF=DAY;ROUTE=SMRTL;BUY=SEND;DefShare=10; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY;
 
---
 
All Other Brokers and DEMO - Short:
 
CXL ABOVEAVGCOST;StopPrice = Price;Share=Price*100;Price=AvgCost;SShare=Price*100;Share=Share-SShare;Price=Share;Price=Share/100;Share=Pos * Price;Price=StopPrice-Bid;SShare=Share / Price;DefShare=BP*0.97;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;SShare=DefShare-SShare;Share=0.5*SShare; Share=Share*1; Price=Bid-0.05;TogSShare;TIF=DAY;ROUTE=LIMIT;SELL=SEND;DefShare=10; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY;
 
All Other Brokers and DEMO - Long:
 
CXL BELOWAVGCOST;StopPrice = Price;Share=Price*100;Price=AvgCost;SShare=Price*100;Share=Share-SShare;Price=Share;Price=Share/100;Share=Pos * Price;Price=Ask-StopPrice;SShare=Share / Price;DefShare=BP*0.97;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;SShare=DefShare-SShare;Share=0.5*SShare; Share=Share*1; Price=Ask+0.05;TogSShare;TIF=DAY;ROUTE=LIMIT;BUY=SEND;DefShare=10; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY;



------------

BHOD/BLOD:

As always, use in simulator. Not widely tested. Know what you're doing. This is for specific high-of-day and low-of-day break scenarios.]

This should work with any broker.

Usage:
1) Double-click where you want your STOP to be if the HOD entry is triggered.
2) Fire hotkey script.
3) It'll calculate your share total based on the HoD price (for the ticker) + 0.01 value and your dbl-clicked stop location using $40 risk as set.
4) It sets a pending STOP order to OPEN a position on the LONG side if the HoD + 0.01 value is hit. Sets a TriggerOrder in the system to create a STOP exit order upon triggering.
    a) If the above pending order is cancelled without fulfillment, the Trigger Order should be cancelled out as well.
    b) If the above pending order is triggered (price => hod+0.01), the Trigger Order will fire and open a STOP exit based on the risk calculations for $40.


LONG SIDE - HIGH OF DAY BREAK:

StopPrice=Price;DefShare=BP*0.97;Price=HI+0.01-Price;SShare=40/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare; Price=StopPrice; Route=STOP;StopType=Market;StopPrice=HI+0.01;TIF:DAY; Buy=Send; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:Price QTY:Pos TIF:DAY; DefShare=20;


SHORT SIDE - LOW OF DAY BREAK:

StopPrice=Price;DefShare=BP*0.97;Price=Price-LOW+0.01;SShare=40/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;Price=StopPrice;Route=STOP;StopType=Market;StopPrice=LOW-0.01;TIF:DAY; Sell=Send; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.3 ACT:BUY STOPPRICE:Price QTY:Pos TIF:DAY; DefShare=20;




EXCEL on Thor's Freeroll logic breakdown, see "Relevant Links" section below.

 

 

Relevant Links:
- Dynamic Hotkeys Thread: DAS - Dynamically Calculate Shares on %Risk or $Risk - Hot Key + Configuration, Updated 9/10/19, v2.1 - DAS Trader Pro Tips and Tricks - Bear Bull Traders Forums
- Spreadsheet for Logic Breakdown of Thor's Freeroll Hotkey Script: https://docs.google.com/spreadsheets/d/1SgeHa0qysaFuZU6VbHJxcDOjhkx1pF-u8lkNcCqjprs/copy

Edited by KyleK29
  • Like 1

---------------------------------------------------------
Profile / Project Pages (Dynamic Hotkeys, StreamDeck Files, and other contributions are located here)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

[[Template core/front/global/mobileNavigation is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

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.