Jump to content
KyleK29

DAS - Dynamically Calculate Shares on %Risk or $Risk - Hot Key + Configuration, Updated 9/10/19, v2.1

Recommended Posts

58 minutes ago, JdWil92 said:

Another thing is with Shorts if thats what order your trying to place, that the equity doesn't have an SSR " short sale restriction 

Hi There - Thanks for getting back to me.  I was trying to go long, but in the couple of times I tried (on varying tickers) shorts to test as well it failed.  Also just checked the montage Style as you suggested, and it's set to 'Stop Order' 😕. I tried searching through the forums and am wondering if it's a rounding/round= issue?

Share this post


Link to post
Share on other sites
22 hours ago, evanmaccam said:

Hi There - Thanks for getting back to me.  I was trying to go long, but in the couple of times I tried (on varying tickers) shorts to test as well it failed.  Also just checked the montage Style as you suggested, and it's set to 'Stop Order' 😕. I tried searching through the forums and am wondering if it's a rounding/round= issue?

Did you copy the scripts, from the downloads section on the BBT website ? and make sure double click to trade is  check marked on your chart config. 

Share this post


Link to post
Share on other sites

I'm having troubles getting this to work while testing this in the TR account (paper trading).

I've built out the script from the excel sheet however I'm seeing an issue with the Stop Loss sent as a Trigger Order.

Here's the script (broken onto new lines for readability):

StopPrice=Price-0.01;
DefShare=BP*0.99;
Share=DefShare*0.333*Price*0.02;
Price=Ask-Price+0.01;
SShare=Share/Price;
Share=DefShare-SShare;
DefShare=DefShare+SShare;
SShare=Share;
Sshare=DefShare-SShare;
Share=0.5*SShare;
TogSShare;
ROUTE=LIMIT;
Price= Ask+0.05;
TIF=DAY+;
BUY=Send;
DefShare=100;
TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.19 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

My steps are:

  • Double click on chart
  • Press Hotkey

What I see happening:

  • Double clicking on chart sets the Price in the Montage
  • Pressing Hotkey my primary order is entered with the correct share size
  • The trigger order status is Failed

Within the Event Log > Trade Tab, I see:

10:00:34	TradeLog	Sending,Buy,TOMZ,164,1.68,SMAT,10:00:35,REDACTED,,,Oid:38338
10:00:34	TradeLog	Accept,Buy,TOMZ,164,1.68,SMAT,10:00:35,REDACTED,,L,Oid:38338
10:00:34	TradeLog	Execute,Buy,TOMZ,164,1.63,SMAT,10:00:35,REDACTED,,L,Oid:38338

Within the Event Log > Trigger Tab I see:

10:00:34	TriggerLog	Accept, F=38338, NEWORDER ACC:REDACTED ACT:SELL SYM:TOMZ EXH:Q QTY:POS RT:STOP PX:1.6 StopType:MARKET StopPrice:, Untriggered, , , , mid:25
10:00:35	TriggerLog	Update, F=38338, NEWORDER ACC:REDACTED ACT:SELL SYM:TOMZ EXH:Q QTY:POS RT:STOP PX:1.6 StopType:MARKET StopPrice:, Triggered, , Failed, No StopPrice defined, mid:25
Quote

No StopPrice defined

This is the part that's confusing me.

The script should be defining the StopPrice at the beginning with:

StopPrice=Price-0.01;

Then later using that variable:

PX:StopPrice-0.19 ACT:SELL STOPPRICE:StopPrice

 

Does anyone know what could be causing this issue or how I can correct it?

My goal is to:

  • Double click on chart
  • Press Hotkey
  • Primary Order is executed
  • Stop Loss is sent based on the Price I double clicked on chart

I thought that is how this would work based on this forum post/excel sheet.

Thanks for taking a look!

  • Like 1

Share this post


Link to post
Share on other sites

Guys I cant for the life of me figure out how to scale in and out with these scripts and make my original stop update with adds or sells correctly. I will post my scripts and hopefully someone can tell me what Im missing.

 

50% short
StopPrice=Price+0.01;DefShare=BP*0.97;Share=DefShare*0.25*Price*0.025;Price=Price-Bid+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price=bid-0.03;TIF=DAY+;SELL=Send;DefShare=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice+0.3 ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

50% Long 
StopPrice=Price-0.01;DefShare=BP*0.97;Share=DefShare*0.25*Price*0.025;Price=Ask-Price+0.01;SShare=Share/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price= Ask+0.03;TIF=DAY+;BUY=Send;DefShare=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0.3 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;

25% Add
CXL ALLSYMB;DefShare=BP*0.97;Share=Pos;SShare=Share *0.25;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=LIMIT;Price=bid-0.05;TIF=DAY+; SELL=Send;DefShare=400;

25% Cover
CXL ALLSYMB;Route=LIMIT;Share=Pos*0.25;Price=Ask+0.03;TIF=DAY+;BUY=Send

25% Sell
CXL ALLSYMB;Route=LIMIT;Share=Pos*0.25;Price=Bid-0.03;TIF=DAY+;SELL=Send

 

Once again all Im needing is to have the original stop update the shares correctly as I scale in and out of the position.

Share this post


Link to post
Share on other sites
32 minutes ago, peterB said:

none of your add/cover/sell scripts contain a stop loss order so no wonder you do not have any stop set after using them

Okay so how do i fix the scripts to update my original stop with the initial order?

Share this post


Link to post
Share on other sites

Ok try adding what you suggested. You mention if you want to add more you just do it again, does that mean you are literally clicking in another stop lost and basically having 2 or more stop losses on the chart or how is your script handling the stops?

I scale in and out of my positions most time to help with either losses or taking profits to early. So I do what I called "starters" which could be like 25% or 50% of my total size for the trade and add or subtract as the trade goes on. But the biggest thing is i never want my initial stop to change or go away until i manually clear it I just want it to update with total shares.

Edited by Throne

Share this post


Link to post
Share on other sites

Hi, I'm very new to trading and sorry if this questions has been asked.

I'd to get any of your help to understand the logic behind Equaliser trade risk. I'm still in using Das simulator.

1/ How come Long EQ $50 with AAPL price at $166.32 can get 445 shares. While LCID Long EQ $50 price at $39. 58 I got 1 share. 

2/ In term of profit/loss, Long AAPL price long, buy at $166.32 and sell to $166.25 (0.07 diff) - loss -$34.25.  Long LCID buy price at $39.58 sell at $30.3 (diff -0.73), +0.71. I mean the movement is higher but less profit.

Appreciate if anyone can enlighten me on this topic. Thank you in advance!

 

Share this post


Link to post
Share on other sites
10 hours ago, peterB said:

1. you clicked wrongly in the chart to set the stop

2. 39.58-30.30 equals 9.28 not 0.71

the idea behind the hotkey is that you click where you want the stop to be and it counts the number of shares to get you the proper number of shares with current price so you risk the desired dollar amount each trade no matter what priced stock you trade (some rounding and slip can occur due various reasons)

thanks Peter for the reply.

1/ noted on number 1, it means I have been clicking it wrongly all this time. Gonna see the videos on execution again.

2/ typo $39.58 sell at $40.3 (diff -0.73)

Share this post


Link to post
Share on other sites
On 12/7/2021 at 3:28 PM, peterB said:

maybe check this to see how it is supposed to work

 

Thanks Peter! hope you guys had a great time at the HQ - watched the YouTube video. look so fun!

Share this post


Link to post
Share on other sites

Hi, the short hotkey has been working for me on the short side but the long hot key script hasn't been working at all
I kept getting "ERROR: Can't get valid price!" message

This is what I have for Long w/out Stop

StopPrice=Price-0;DefShare=BP*0.925;Price=Ask-Price+0.00;SShare=1000/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=MSPOL;Price=Ask+0.05;TIF=DAY+;BUY=Send;DefShare=200;

 

Edited by bluethetien

Share this post


Link to post
Share on other sites
2 hours ago, bluethetien said:

StopPrice=Price-0;DefShare=BP*0.925;Price=Ask-Price+0.00;SShare=1000/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=MSPOL;Price=Ask+0.05;TIF=DAY+;BUY=Send;DefShare=200

Hello Bluethetien,

As you said the script for long w/out stop, it doesn't make sense.  The script will open a long position but logically it is not accurate for opening only a long position or with a stop lose order.  I will suggest you to read this post from the very beginning, so you will understand how any script works.

Best of luck.

Edited by zulkafil

Share this post


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

Hello Bluethetien,

As you said the script for long w/out stop, it doesn't make sense.  The script will open a long position but logically it is not accurate for opening only a long position or with a stop lose order.  I will suggest you to read this post from the very beginning, so you will understand how any script works.

Best of luck.

 



Long with $20 risk per trade WITHOUT Stop Order:
StopPrice=Price-0;DefShare=BP*0.925;Price=Ask-Price+0.00;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=200;

---

Short with $20 risk per trade WITHOUT Stop Order:
StopPrice=Price+0;DefShare=BP*0.925;Price=Price-Bid+0.00;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price=Bid-0.05;TIF=DAY+;SELL=Send;DefShare=200;

---

I got the script from this Youtube video. The short side of the script has been working for me but not the long side

Edited by bluethetien

Share this post


Link to post
Share on other sites

Hello,

  • Without a stop order how are you risking only $20? You are risking the total amount of an open position.
  • The initial script you provided "StopPrice=Price-0;DefShare=BP*0.925;Price=Ask-Price+0.00;SShare=1000/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=MSPOL;Price=Ask+0.05;TIF=DAY+;BUY=Send;DefShare=200"
    • See the bold items in your script, 1000 means risking $1000 if you place an stop order when you open a long position
    • ROUTE=MSPOL , I didn't get it. It should be ROUTE=LIMIT (SMRTL for IB) if you are placing a limit order.

Finally I will say that, someone should have basic knowledge of script when he/she uses any script.

Always try your new scripts in sim first for safety.

Best of luck..

Share this post


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

Hello,

  • Without a stop order how are you risking only $20? You are risking the total amount of an open position.
  • The initial script you provided "StopPrice=Price-0;DefShare=BP*0.925;Price=Ask-Price+0.00;SShare=1000/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=MSPOL;Price=Ask+0.05;TIF=DAY+;BUY=Send;DefShare=200"
    • See the bold items in your script, 1000 means risking $1000 if you place an stop order when you open a long position
    • ROUTE=MSPOL , I didn't get it. It should be ROUTE=LIMIT (SMRTL for IB) if you are placing a limit order.

Finally I will say that, someone should have basic knowledge of script when he/she uses any script.

Always try your new scripts in sim first for safety.

Best of luck..

I'm referring to the youtube video.
So in Das I have "Double-click to trade" enable.
image.png.9c31497ee76ebe4b732530c41edeb39f.png
For example, if the stock's current price is trading at $10 and i want to long the stock with a risk of $1000 per trade. Let's just say my "mental" stop loss level is at $9, then I will just double click $9 on the chart and press the hot key(script)
It should auto calculate and give me 1000 shares since the distance between $10 to $9 is $1 which is 1000 shares
as for MSPOL, It is a route that I use a lot which is "MEMX Post only"

This script is for Das trader pro as the Youtube video stated. I don't use IB.

I use the same kind of script for short and it's perfectly fine for over 6 months
I just need this script to calculate the shares for me normally I have "BUY=Send" as "BUY=" so it doesn't send the order out.

Edited by bluethetien

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.