Jump to content

Recommended Posts

Hi Everyone,

I am trying to setup a buy hot key that automatically set a stop order that has a fixed max loss dollar amount and have it calculate what the stop loss price would be at

For example. I want to buy 100 shares of a $30 stock and have a max $50 loss. So the raw math would be $30 - $50/100 or AvgPrice - 50/Pos

Here is the hot key i have but it does not set the stop for some reason

CXL ALLSYMB; ROUTE=LIMIT;Price=Ask+0.05 ;Share=100 ;TIF=DAY+;Buy=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET ACT:SELL STOPPRICE:AvgCost-50/Pos QTY:Pos TIF:DAY+;

 

Thanks Everyone!!

Share this post


Link to post
Share on other sites

If you're OK with using a separate hotkey to set the stop loss below is the script I use for a $50 max loss when going long.

ROUTE=STOP;StopType=Market;Share=Pos;StopPrice=50/Share;StopPrice=AvgCost-StopPrice;TIF=DAY+;SELL=Send

Share this post


Link to post
Share on other sites
On 11/10/2020 at 8:43 AM, WestCoastTrader said:

Hi Everyone,

I am trying to setup a buy hot key that automatically set a stop order that has a fixed max loss dollar amount and have it calculate what the stop loss price would be at

For example. I want to buy 100 shares of a $30 stock and have a max $50 loss. So the raw math would be $30 - $50/100 or AvgPrice - 50/Pos

Here is the hot key i have but it does not set the stop for some reason

CXL ALLSYMB; ROUTE=LIMIT;Price=Ask+0.05 ;Share=100 ;TIF=DAY+;Buy=Send;TriggerOrder=RT:STOP STOPTYPE:MARKET ACT:SELL STOPPRICE:AvgCost-50/Pos QTY:Pos TIF:DAY+;

 

Thanks Everyone!!

Have you checked out this 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

As a side note, you can't currently do a lot of math in the Trigger Orders as it won't properly flatten the values so it tries to pass it as literal strings.  The general syntax available is AvgCost+## or AvgCost-## and those tend to go in correctly.

 

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

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.