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.

Ákos Maróy

DAS script to limit total position value?

Recommended Posts

Ákos Maróy

Hi,

I'm using CME for training on DAS Trader, and apparently they have a $150k limit for open positions on each symbol. Unfortunately this limit kicks in sometimes when I'm using a hotkey / script to place a position with a certain risk, or even sometimes with a fixed number of shares.

As I'm not that knowledgable about DAS Trader scripting, I wonder if someone could give me a pointer into how to extend a script to limit the number of shares in a buy or sell order so that the total size of the open position for that symbol doesn't exceed $150k?

For example, this is my script to place an order with a risk of $1000:

StopPrice=Price-0.01;DefShare=BP*0.97;Price=Ask-Price+0.01;SShare=1000/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;

How would I update this so that the total size of the position for this particular symbol would not exceed $150k?

Any pointers welcome.

 

Ákos

Share this post


Link to post
Share on other sites
RussWilliamL

doesn't DefShare=BP*.97 limit the max position?

if so, try changing it to DefShare=150000/Price and see how that works (in SIM)

Share this post


Link to post
Share on other sites

[[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.