Order risk management based on price level plots


Category:
0
0

 I am looking for the solution for the following requirement.

Is it possible to achieve automatically with thinkorswim script?

Add two line of drawings in chart: Price level 1, Price Level 2.

The “Price level 1” will be used for order entry price, lets say it is price1

the “Price level 2” will be used for stop loss price, lets say it is price2

We expect the price bounce back at the price1 level, so a selll limit order is placed with

the risk manamgement at p/l ration 2:1 and risk in 1% of account value.

The order quantity 

 qty = ( total portoforlia value * 1% )/(price2-price1)

 Once the stock appoches to level1, for instance, 0.5% of the price below the price1, a custom order with OCO bracket ( one limit sell order at price1 in quanty qty, one stop order at price2, ane one close order at target price price1-2*(price2-price1) .

 Thank you for your help.

 Best, bill

 

 

 

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on April 13, 2020 12:44 pm
96 views
0
Private answer

The only portion of this request that is possible is to manually draw the two lines on the chart and to manually enter an OCO order at the desired price.

There is nothing in the code for Thinkorswim for the following:

  1. That permits us to create, modify or in any way interact with drawing objects on the chart
  2. That permits us to write any code that trades directly from a chart
  3. That would permit us to write any code that reads portfolio (net equity) value
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on April 13, 2020 2:01 pm
0
3. That would permit us to write any code that reads portfolio (net equity) value seems possible, since there is a script available for sale. https://easycators.com/thinkscript/thinkorswim-position-sizer/ but it is not flexible enough, it generates the order only based on predefined criteria. Any API or code we can use to get the price of price level draw? The logic would be very similar to the one for the alert which we can define on the chat based the price is >= or
( at April 13, 2020 6:05 pm)
0
If there were any that I knew of to accomplish any of the items I said we could NOT do I would have most certainly included that in my response.
( at April 13, 2020 6:40 pm)