Jump to content
Day-Meister

Defined Risk Hotkeys for multiple range orders

Recommended Posts

Could anyone show me how to change this slightly to take 35% profit at 2R, 35% profit at 3.5R, and let the balance of 30% shares run after that?

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites
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.

 

Share this post


Link to post
Share on other sites
On 2/9/2022 at 11:02 AM, Quy Doan said:

 

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

This image should  be in the first post so people understand what it does without having to read it all.

Edited by Miah

Share this post


Link to post
Share on other sites

@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?

 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
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

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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+;

 

Share this post


Link to post
Share on other sites

Happy Holidays!

Instead of clicking on the chart to get a stoploss price, can you help advise a hotkey to buy or sell with a 20 cents stoploss relatively to the entry price? The fixed $risk amount will be $20/entry, and ideal targets would be 50%position at 3R and all out at 5R.

Thank you so much for your help.

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.