Jump to content
JDen

Script for automatically moving stoploss to breakeven when in profit

Recommended Posts

Hello everyone,

I am aware that DAS provides hotkeys for moving a stoploss to breakeven. However, these hotkeys require that I manually press the key combination that triggers the action.

Is it possible to write scripts in DAS such that, upon reaching a certain unrealized PnL in an order, the stoploss is automatically moved to breakeven WITHOUT pressing a hotkey? For example, I enter an order and when I am in 100$ profit I want the stoploss to go to breakeven automatically without pressing a hotkey.

Such scripts are common in other platforms, but I couldn't find a way or writing them in DAS.

Thanks!

Share this post


Link to post
Share on other sites

this triggering is not possible in DAS as far as i know but you can bypass it by inserting a 1 share future partial order which can automatically set your stop loss to BE which is commonly used hotkey

  • Like 2

Share this post


Link to post
Share on other sites

That's a good workaround. Thank you! So the size of the stoploss would be the original position size + 1 in this case. Do you have a sample of such a hotkey by any chance?

Share this post


Link to post
Share on other sites

Oh I see you mean partially closing 1 share. In this scenario could I have 2 take profits simultaneously in DAS? One of 1 share only for triggering the stoploss and one for the rest of the position.

Share this post


Link to post
Share on other sites

forget it, it cannot be done the way you need it. you just need to press it at the right time yourself.

you cant put a limit order which would move your stop. the order can be in a single hotkey but the execution cannot be scheduled

Share this post


Link to post
Share on other sites

I see, that's a pity because then you pretty much can't leave the screen unattended for a longer period of time (2-3 hours) as I was intending. Thanks for the reply!

Share this post


Link to post
Share on other sites

you can put a range order right away but the problem is if you want to move the stop later on- you need to move it manually

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.