Jump to content
Medved Trader Forums

Clarification regarding saved order


AntoineOpala

Recommended Posts

Hello,

My goal is to create the following saved order :

- Buy/sell (depending on which DOM column the mouse is currently over) StopLimit (Stop = PriceAtMouse; Limit = PriceAtMouse+0.01), 83 quantity.
   It is an OTOCA. Therefore, two more orders come with it. An order to buy/sell (whichever is the opposite of the first action above) StopMarket at PriceAtMouse-0.06. This is basically my stoploss.
   Another order to buy/sell (whichever is the opposite of the first action above again) at PriceAtMouse+33. This is my take profit.

Which formulas would be the correct ones? I cannot find what works to buy or sell depending on which DOM column the mouse is at.

I currently have programmed the following thing, but the action "CapOrderType" doesn't work. Using it creates the following message: Error in tag "Action": CapOrderType is invalid - mouse is not over the window." Yet, I guarantee you I'm executing this in a DOM window.

image.png.9e53e26c58c16009e76ee5fa9afd3ed2.png


Best regards,

Antoine

Edited by AntoineOpala
Link to comment
Share on other sites

CapOrderType is the order type of the Capsule over which the mouse is hovering. Since there is no capsule, don't use it.

I would suggest using instead

PriceAtMouse<=Price?'Buy':'Sell'   for the main order and

PriceAtMouse<=Price?'Sell':'Buy' for the legs?

Also - I am not sure how you decided on your limit and stop prices both in main and in legs. That doesn't look like it works both for sells (if mouse is on left side of DOM) and buys (if mouse is on right). Are you sure about those?

Link to comment
Share on other sites

Your first suggestion, for the main order, works perfectly. It is indeed what I needed there. Thank you.

For the legs, it doesn't work as intended. I'm trying to flip the stoploss and target prices upside down depending on whether the main order is long or short. If the main order is long, the stoploss should be -0.06 below the entry price. This is currently the case ✔. If the main order is short, then the stoploss should move around to the other side and be +0.06 above the entry price. This is currently not the case . How to program this?

Currently, the stoploss is always below the entry price regardless of whether I'm buying or shorting a stock. It should flip above in case I'm shorting.


The limit and stop prices I decided are designed to make me risk $5 per trade. Basically, if I buy 83 stocks and if my trade fails, I will only lose 83 * $0.06. If you do the math, I will only lose $4.98. As for my target limit order, it is set to +33. I know it's too far to trigger. I'm doing this just so a target limit order exists in the machine. I can later adjust its price on the fly depending on where the market will have gone.

Edited by AntoineOpala
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...