Jump to content
Samma

Hotkey to partial a position (either direction), move stop to brekaeven

Recommended Posts

Posted (edited)

Hi everyone,

 

I'm stuck on this one. It has to do with how the hotkey calculates shares to update stop position share size. I'm trying to create two hotkey scripts:

  1. If long, add to an open position (e.g. +50%) and move stop to breakeven. If short, partial from an open position (e.g. -50%) and move stop to breakeven. Basically a buy % of position hotkey that works for both directions with a new breakeven stop.
  2. If long, reduce an open position (e.g. -50%) and move stop to breakeven. If short, add to an open position (e.g. +50%) and move stop to breakeven. Basically a sell % of position hotkey that works for both directions with a new breakeven stop.

I'm hung up on the stop in the hotkey script. I think it has to do with the stop direction and share size (selling during a short position adds shares short as opposed to reduces position share size).

 

Anyone have such a script? I've pored over Kyle's scripts but they are so complex, I'm a bit lost.

Edited by Samma

Share this post


Link to post
Share on other sites

Thanks Peter, looks to be a wealth of knowledge on there but exactly what I wanted. I'd like to learn how to code my own hotkeys.

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.