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.

Robert H

Hotkeys for Flipping Position

Recommended Posts

Robert H

EDIT 16-APR-2018: With the help of Raymond W, we've been able to define a single hotkey for flipping an open position:

Simulator: ROUTE=MARKET;Share=Pos*2;TIF=DAY+;SEND=REVERSE

Interactive Brokers: ROUTE=SMRTM;Share=Pos*2;TIF=DAY+;SEND=REVERSE

 

Note that this hotkey will send a market order.

 

=====

 

I'm trying to define a single hotkey to switch an open position. For now, I was able to create two separate hotkeys for switching a long-to-short, and a short-to-long.

 

Flip Long to Short

ROUTE=SMRTL;Share=Pos*2;Price=Bid-.05;TIF=DAY+;SELL=Send

 

Flip Short to Long

ROUTE=SMRTL;Share=Pos*2;Price=Ask+.05;TIF=DAY+;BUY=Send

  • Thanks 1

Share this post


Link to post
Share on other sites
Jason H.

This is cool, I'm going to test it for sure!

Share this post


Link to post
Share on other sites
Greg K

Very cool Robert! I could have used this today in trading BABA. Sorry I don't know the answer to your question.

 

Share this post


Link to post
Share on other sites
Martin

Added it to my Hotkeys. Gonna try it today.. Thanks!!

Share this post


Link to post
Share on other sites
Martin

Hi Robert, I used the hotkey today to flip a position from short to long, but i did not work out well.

i was short MU with 183 Shares and after flipping it to long i was in possession of 2 Shares :) Long to short works fine.

i think its because of the -2 in the script.

 

instead of

 

ROUTE=SMRTL;Share=Pos*-2;Price=Ask+.05;TIF=DAY+;BUY=Send

 

i was trying

 

ROUTE=SMRTL;Share=Pos*(-2);Price=Ask+.05;TIF=DAY+;BUY=Send

 

but that does not work either. I was playing around but i couldnt figure it out. Any suggestions?

 

 

 

 

Share this post


Link to post
Share on other sites
Robert H

Great catch, Martin! I updated the original post with the corrected script:

 

ROUTE=SMRTL;Share=Pos*2;Price=Ask+.05;TIF=DAY+;BUY=Send

  • Like 1

Share this post


Link to post
Share on other sites
Robert H

With the help of Raymond W, we’ve been able to define a single hotkey for flipping an open position:

Simulator: ROUTE=MARKET;Share=Pos*2;TIF=DAY+;SEND=REVERSE

Interactive Brokers: ROUTE=SMRTM;Share=Pos*2;TIF=DAY+;SEND=REVERSE

 

Note that this hotkey will send a market order.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
FlourishingWeee

So, to close an open position, long or short, I could just use this one hotkey right?

ROUTE=SMRTM;Share=Pos;TIF=GTC;SEND=REVERSE

 

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.