How to Scale orders


Category:
0
0

Hi,
I want to make my strategy scale in and scale out. Below is a trite, yet easy example.

Scenario:
– BUY @ $1.00 GBP/USD for 2 lots.

Desire:
– SELL @ $1.0010 (ten pips profit) GBP/USD for 1 lot.

Effect:

The desired effect here is to reduce the total size of the position by 1 full lot (scale down) given some condition.
Would i just do the following?

if (initialEntryCxn) then AddOrder(OrderType.BUY_AUTO, initialEntryCxn, open[-1], 20000, Color.Uptick, Color.Uptick, Color.Uptick);
else if (scaleOutCxn) then AddOrder(OrderType.BUY_AUTO, scaleDownCxn, open[-1], 10000, Color.Yellow, Color.Yellow, Color.Yellow);
else if (closeAllPositions) then AddOrder(OrderType.BUY_AUTO, closeAllPositions, open[-1], 10000, Color.Red, Color.Red, Color.Red)
else 0;

Much appreciated for feedback. Apologies if i missed this question previously answered, i didn’t see anything in the search results.

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on February 27, 2021 9:41 pm
195 views
0
Private answer

Using chart strategies on Thinkorswim, it is possible to scale in but not possible to scale out. There is nothing you can do within the code to facilitate this. It can only be accomplished through global setting. Screenshot below shows where to locate that setting.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4117)
Answered on February 28, 2021 8:45 am