Jump to content
Jinagt

Partial Hotkey based On Unrealized P&L

Recommended Posts

Hi Everyone ,

I am looking for a DAS hotkey that can take a partial at certain $ amount using  Unrealized P&L as a base.
I have other hotkeys for  like % ones and 2:1s but if anyone has this hotkey that would be a great help. 

I am attaching an image for reference.
Thank You

 

UnrealizedP&L.PNG

Share this post


Link to post
Share on other sites

To be clear, you're looking for a hotkey that partials a fixed dollar amount, e.g. $100, $50, or whatever. The amount you partial has nothing to do with the total amount of Unrealized P&L, correct?

Share this post


Link to post
Share on other sites
5 hours ago, JasonH said:

To be clear, you're looking for a hotkey that partials a fixed dollar amount, e.g. $100, $50, or whatever. The amount you partial has nothing to do with the total amount of Unrealized P&L, correct?

Yes Jason I would like to lock my profit at $100 in one partial and run the rest of my shares for the further move.

Share this post


Link to post
Share on other sites

I think I have found a way to do this. It requires modifications to both your entry and exit hotkeys. For the entry hotkey, you need to add "Price=Ask" at the end:

Buy (long position):

Price=ASK+.10; Share=BP*.98;  TIF=DAY+; ROUTE=LIMIT; BUY=Send; Price=Ask;

"Price=Ask" stores the purchase price in the montage PRICE field. This may not be the actual purchase price (your order is ASK+0.10 in this case) but I don't think the hotkeys have a way to actually retrieve the real price your order was filled at. (It'd have to see into the future.)

Sell/Partial:

Price=Price-Bid; Share=100/Price; Price=Bid-.10; TIF=DAY+; ROUTE=LIMIT; SELL=Send;

The commands in bold are essentially doing this:

number_of_shares = $100 / (sell_price - current_price)

Remember it's an approximation since the hotkey doesn't now what price your orders are actually being filled at. So it just assumes the best Bid and Ask prices in the Level II.

Share this post


Link to post
Share on other sites

FYI, this hotkey will fail if you don't have >$100 in Unrealized P&L. Since it approximates entry/exit prices using best Bid/Ask prices, it may even fail in some cases around $100. So don't delete your other hotkeys in case that happens!

Share this post


Link to post
Share on other sites
14 minutes ago, JasonH said:

FYI, this hotkey will fail if you don't have >$100 in Unrealized P&L. Since it approximates entry/exit prices using best Bid/Ask prices, it may even fail in some cases around $100. So don't delete your other hotkeys in case that happens!

Thank You Jason, I really appreciate your help. I will test the Hotkey in sim on Monday and let you know.

Share this post


Link to post
Share on other sites

Hi Jina,

Regarding the chat message this morning. Are you trying to do this on-the-fly (e.g. the price moves in your favor and you want it to dynamically calculate the shares needed to sell to return 1-R in profit at the current price area when you hit the hotkey) or as a pending order in the system?

The latter method is way easier and a few scripts exist for this ... I haven't released these as they were pending DAS bug fixes and are complex to configure, I need to test them in the latest DAS production version.

 

 

 

 

 

Edited by KyleK29

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

Share this post


Link to post
Share on other sites
1 hour ago, KyleK29 said:

Hi Jina,

Regarding the chat message this morning. Are you trying to do this on-the-fly (e.g. the price moves in your favor and you want it to dynamically calculate the shares needed to sell to return 1-R in profit at the current price area when you hit the hotkey) or as a pending order in the system?

The latter method is way easier and a few scripts exist for this ... I haven't released these as they were pending DAS bug fixes and are complex to configure, I need to test them in the latest DAS production version.

 

 

 

 

 

Hi Kyle, I am a reversal trader. Some times I enter 2 trades at the same time and I couldn't keep up with the 2 at the same time, So I would like to take a partial at certain $ amount($100) when my Unrealized P&L is more than $100 and keep the rest of the shares for catching further move. No relation to my R.
Thank you for your Time and effort to help me.
Jina 

Share this post


Link to post
Share on other sites
1 hour ago, Jinagt said:

Hi Kyle, I am a reversal trader. Some times I enter 2 trades at the same time and I couldn't keep up with the 2 at the same time, So I would like to take a partial at certain $ amount($100) when my Unrealized P&L is more than $100 and keep the rest of the shares for catching further move. No relation to my R.
Thank you for your Time and effort to help me.
Jina 

Jina, what problems did you run into? The hotkeys I mentioned worked for me today in sim.

Share this post


Link to post
Share on other sites
55 minutes ago, JasonH said:

Jina, what problems did you run into? The hotkeys I mentioned worked for me today in sim.

Hi Jason, I tried the hotkey today with JMIA in sim, At the time  I am hitting the Hotkey my P&L was $175 but it saying can't get the valid price. I used Kyle's  $ risk hotkey for entry and used yours's for partial is that the reason I got error message?

Share this post


Link to post
Share on other sites

Jina, did you update your BUY/ENTRY hotkey too? You have to update that hotkey as well. You need to add "Price=Ask;" at the end of the entry hotkey. That command stores the price in the montage window, which is retrieved later when you need to sell to capture $100. My post from Friday gives more details.

The "can't get valid price" error message sounds reasonable if you didn't update the entry hotkey.

Edited by JasonH

Share this post


Link to post
Share on other sites
1 hour ago, JasonH said:

Jina, did you update your BUY/ENTRY hotkey too? You have to update that hotkey as well. You need to add "Price=Ask;" at the end of the entry hotkey. That command stores the price in the montage window, which is retrieved later when you need to sell to capture $100. My post from Friday gives more details.

The "can't get valid price" error message sounds reasonable if you didn't update the entry hotkey.

 

1 hour ago, JasonH said:

Jina, did you update your BUY/ENTRY hotkey too? You have to update that hotkey as well. You need to add "Price=Ask;" at the end of the entry hotkey. That command stores the price in the montage window, which is retrieved later when you need to sell to capture $100. My post from Friday gives more details.

The "can't get valid price" error message sounds reasonable if you didn't update the entry hotkey.

 

Just as a general note. I wouldn't do the price=ask; at the end of the entry script. DAS has quite a few toggle-able options that will erase this once the order executes it (different resets, e.g. reset price on execution). It can also be erased if you switch to a different symbol, enter another trade, and/or switch back. It can lead to this "can't get valid price" error.

Since the way you suggested is a pair hotkey (one for entry, and one for taking profit). You can use Price=AvgCost; at the beginning of the take-profit hotkey instead .. that will get the exact price value without having to worry about the montage keeping it.

4 hours ago, Jinagt said:

Hi Kyle, I am a reversal trader. Some times I enter 2 trades at the same time and I couldn't keep up with the 2 at the same time, So I would like to take a partial at certain $ amount($100) when my Unrealized P&L is more than $100 and keep the rest of the shares for catching further move. No relation to my R.
Thank you for your Time and effort to help me.
Jina 

You mentioned above that you're using the dynamic $Risk hotkeys to enter the position. If you are, then this would be best to do it as a factor of R, this normalizes the hotkeys to get best results. Example:

- You enter a position with $50 risk at $10.00, stop is at 9.50. This purchases 100 shares.

1R = $50

With this in mind, for you to realize a take-profit of $100 you would either need to sell 100% of the position at $11.00 (2R move), or 75% of the position at $11.50 (3R move), and so fourth. [This math changes if you're using a $100 risk hotkey]

How you break that profit taking down would be up to your strategy (e.g. maybe you sell 75% at 10.75, keeping 25% for further move).

This is not too far off how I trade it. My entry triggers all of my take-profits at various R levels which I've premapped out (e.g. 10% @ 1.5R, 20% at 2R, etc.) according to my strategy.  It's a semi-autonomous approach, allowing for management of the trade to just be adjusting the stop (e.g. if you're following using a MA as the support level).

The advantage is it makes it so you can focus on multiple trades at once, which is why I switched to doing it this way over the manual approach of scaling out.

 

 

Edited by KyleK29

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

Share this post


Link to post
Share on other sites
1 minute ago, KyleK29 said:

Since the way you suggested is a pair hotkey (one for entry, and one for taking profit). You can use Price=AvgCost; at the beginning of the take-profit hotkey instead .. that will get the exact price value without having to worry about the montage keeping it.

Awesome! I was looking for way to get something like that...

Share this post


Link to post
Share on other sites

Hi Kyle,

1. Entry Positions: I too am in SIM, and my 3 month subscription is expiring next week. I have been using your Fixed $ Risk Hotkeys for Long and Short. I changed it from $20 to $50. One issue that I have is that if I double click the chart too far away from the current price, it buys a small # of shares (I get the math behind why), and if I buy right near the price, it buys almost too many shares and then I often get stopped out before I have a chance to manually drag the Stop Loss down. For new traders, what do you suggest? 

2. Partialing Out: I also have a sell/cover 25%, 50% and 100% button and also a "break-even" button that cancels any open stop loss and moves it back to the break-even (based on the original entry). What is the best way to partial out? Is there a hotkey similar to what you describe in this thread that can help me better scale out based on Risk/Reward amounts or percentages based on my risk? So a $50 Risk is 1 R, right? So if I want to scale out at 2R or 3R, what do you suggest I do to achieve this? 

Thanks! 

-Reagan 

Share this post


Link to post
Share on other sites
Quote
18 hours ago, KyleK29 said:

Since the way you suggested is a pair hotkey (one for entry, and one for taking profit). You can use Price=AvgCost; at the beginning of the take-profit hotkey instead .. that will get the exact price value without having to worry about the montage keeping it.

Quote
On 12/4/2020 at 9:09 PM, JasonH said:

Price=Price-Bid; Share=100/Price; Price=Bid-.10; TIF=DAY+; ROUTE=LIMIT; SELL=Send;

 

Hi Jason and Kyle Thank you for the help

I tried the Partial hotkey  today Price=AvgCost; Share=100/Price; Price=Bid-.10; TIF=DAY+; ROUTE=LIMIT; SELL=Send; but it only sold 2 number of shares.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

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