- Messages : 255
- Remerciements reçus 0
ScaleTrader Orders in the Trader Workstation Platform
- Masters Trade
-
Auteur du sujet
- Hors Ligne
- Administrateur
-
Moins
Plus d'informations
il y a 2 semaines 3 jours #81
par Masters Trade
ScaleTrader is based on the principle of buying stock as its price drops, or purchasing assets at the lowest price in a narrowing market, or conversely—selling in a broad market or increasing a long position. Additional features have been introduced into it, such as support for pair trades and multi-leg combinations with built-in profit-taking until canceled. ScaleTrader can be used for any IB products (except mutual funds) and features three customizable templates:
1. Simple – create a simple trade on an individual underlying to help you buy assets at the lowest price in a narrowing low-demand market, sell in a broad market, or build a long position.
2. Pair – create a strategy for two related stocks (essentially a stock-to-stock combination) where you buy one stock and sell the other based on the price difference between them.
3. Combo – create a standard or well-known multi-leg strategy to trade stock, option, or futures combinations.
In this webinar, we will cover simple trades and then pair trades in ScaleTrader. Although today we will focus on selling, everything discussed applies in reverse and across various products.
image missing https://guild.masters.trade/images/forum/tws_tools/scaletrader1.png
Overview of ScaleTrader
As our first example, we will create an order to buy shares of a stock we believe is near a price bottom. ScaleTrader will execute purchases as the stock price approaches a historic low and sell it when it recovers, then buy again during the next dip. This is known as "scale trading".
As you know, there are several convenient ways to open every tool in TWS. Today we will start from the Mosaic workspace, which we hope will become the main starting point for clients in the future. We promote Mosaic as IB's all-in-one interface for research, analytics, and order creation, powered by IBIS and customizable market data subscriptions. ScaleTrader can be opened via the New Window drop-down menu. As you can see, scrolling down to the very bottom and selecting More Advanced Tools places ScaleTrader at the top of the list. Instead, we will start from the Mosaic Market Scanner, which allows searching for stocks trading near the bottom of their price range.
Mosaic does not have a prebuilt 52-week High/Low scanner that we need, so I will quickly create one. In the Watchlist Plus window in Mosaic, click the "New Tab" button and select "Market Scanner". Create a custom scanner and choose 52-Week High and 52-Week Low fields from the "Add Field" list under the "Fields & Filters" section. I will place the "52-Week Low" field next to the "Last" field to easily identify stocks whose 52-week low is closest to their current last price. Once the desired symbol is found, right-click it, select "Trade", choose the order ticket, and open ScaleTrader from the Scale tab.
Simple Scale Order
ScaleTrader always opens on the "Simple" tab, which is where we will begin today. The algorithm includes two additional tabs: "Pair" and "Combo". First, we will create a simple scale order to learn the basics, then switch to the "Pair" tab to create a pair algorithm.
By default, the action is set to "Buy", so we will leave it as is.
Now we enter the maximum position value—the total number of shares we wish to accumulate during price dips (enter 10,000). Keep in mind that the value in this field applies specifically to the position within this algorithm instance.
Since we do not want to submit an order for all 10,000 shares at once, we need to specify component sizes for transmission. Initial size is the number of shares you want to buy at the starting price; subsequent size is the number of shares the algorithm will purchase at each subsequent lower price level (determined by the price increment). We will set both initial and subsequent component sizes to 400 shares. We will also use the size randomization feature so the algorithm remains undetected in the market. With a base component size of 400, randomized transmitted components can range between 200, 300, 400, 500, or 600 (plus/minus 55% rounded to the nearest hundred).
Enter the starting price and price increment. We will set the bid as the starting price and 2 cents as the price increment. This means each subsequent purchase component price will be 2 cents lower.
Now look at the calculated maximum and minimum prices. Since our initial and subsequent sizes are identical, the starting price and top price coincide. If the initial size were larger, the top price would exceed the starting price by the difference between subsequent and initial component sizes, multiplied by the price increment. For example, if we set 800 as the initial component size (twice the subsequent size of 400), the starting price would be 2 x 0.02 or 4 cents higher than the base price. This is relevant mainly when using ScaleTrader for selling off a position. Detailed information can be found in the "TWS User Guide".
Minimum price is the price at which the final buy order will execute if the price drops to the bottom of the range. When modifying the minimum price, notice that the price increment adjusts automatically to compensate. You can adjust prices manually or by dragging lines on the chart.
Now select the order type: Limit or Relative. If we use a Relative order with zero offset, orders will always be pegged to the bid, even when the increment specifies a higher price. Adding an offset of 0.01 makes our bid one penny higher than NBB, provided it is equal to or lower than the next scale price level. Using a penny offset increases execution chances, though execution may occur at a slightly less favorable scale price.
Profit Offset
At this stage, we could transmit a basic scale order, and ScaleTrader would attempt to reach our max position and stop. Traders often use this strategy to build a long position.
However, that is not our goal here. We can sell during periodic price spikes or liquidate our position upon reaching a target profit level by creating profit-taking orders and setting a profit offset.
Profit offset is the amount of profit we want to capture on the exit trade. Setting a 20-cent offset means the first sell order will be submitted at a price 20 cents higher than the first buy component price. A key detail: if a buy order executes at a price higher than the peg reference price, the corresponding sell order price will still be determined using the static price increment; the sell price is not adjusted based on actual execution price. We capture additional profit every time the stock price fluctuates.
As the stock rises, the position will be sold off in subsequent component sizes at price increments defined during the buy phase. The final sale will take place at the highest price plus the 20-cent profit offset.
Restore Size
If we submit an order with only a profit offset configured, the algorithm will buy and sell at each price level only once and then stop.
However, there is also a "Restore Size After Taking Profit" feature. This means the algorithm will attempt to rebuy shares sold for profit at the price they were originally bought. This allows us to repeatedly buy and sell in a volatile market, acting like a market maker. This strategy works best when setting relatively small price increments and profit offsets. Let's change the profit offset from 20 cents to 4 cents.
In this case, the algorithm will remain active as long as the stock price stays within the range defined by (max price + price offset) and the minimum price.
Creating Pair Trades
Now let's examine creating pair trades. Pair trading in ScaleTrader involves trading the price difference of a non-guaranteed two-leg stock/stock combination. Once the pair is selected, we treat the price difference just like an individual stock price in a simple trade.
Today we will look at a pair trade using two stocks that historically showed a close price correlation—in this case, Wal-Mart and Target—where prices have diverged. We will buy the higher-priced stock as its price dips and sell the lower-priced stock as its price rises, executing this as a two-leg combination we purchase. Although we describe a buy transaction, all principles apply in reverse and across different products.
First, open the "Pair" tab and select "Edit Pair". Now we enter ticker symbols for both legs. We configure parameters to buy the higher-priced stock and sell the lower-priced stock, which we consider mispriced relative to each other.
Net Amount is the difference between legs (leg size x price difference), while Price Difference reflects underlying price divergence. We will select Price Difference and click Create to generate the pair.
Note that IB cannot guarantee this combination. This means there is a slight possibility of executing only one leg of the pair. If this happens, the second leg order may execute at a less favorable price, though you will not be left with an unhedged position.
Now let me highlight the ScaleTrader chart. You might think the chart displays both tickers in our combination, but it actually shows the price difference between them, which is what we are trading. You can change the chart timeframe to view 3-month, 6-month, or 1-year history.
Creating Pair Orders
Core order parameters here are similar to those in our first example. We will create a buy order. Notice that when creating a pair, the component size field precedes the max position field.
Component Size – 400 each.
Note that using equal values keeps the combination ratio at 1:1; altering share quantities changes this ratio. This ratio must match the ratio in max position fields.
Max Position – 50,000 each. Use size randomization so the algorithm remains undetected. With component sizes of 400, transmitted components can be 200, 300, 400, 500, or 600, while avoiding minimum commission surcharges.
This maximum applies only to this algorithm instance; your overall portfolio position may differ.
Use size randomization so the algorithm remains undetected. With component sizes of 400, transmitted components can be 200, 300, 400, 500, or 600, avoiding minimum commission surcharges.
Enter starting price. For example, if the combination price difference is 4.75, set 4.70 as the initial bid price. Treat the price difference just like an individual asset price. Price Increment – set to 0.05.
Price can be set manually or by dragging the "starting price line" on the chart.
Notice that max and min prices are calculated automatically. Adjust the min price by moving the line on the chart and note the automatic recalculation of the price increment.
Order Types – these combination order types are designed to maximize execution chances for both legs (since it is a non-guaranteed order).
LMT + MKT – both legs submitted as limit orders. If only one executes, the second converts to a market order.
REL + MKT – both legs submitted as relative orders (pegged to buy bid or sell ask). If only one executes, the second resubmits as a market order.
Profit-Taking Order
While we could transmit an order with only these parameters, we want to achieve more. We will continue configuring parameters to instruct the algorithm to buy and sell, capturing value from market fluctuations.
First, we create a profit-taking order instructing the algorithm to send an opposite order—in this case, a sell order after current buy execution. As with basic orders, profit order pricing is based on component price plus profit offset, not actual execution price.
Let's enable this feature and set a profit offset of 2.00. Now let's walk through an example. For simplicity, we ignore size randomization. Suppose the first buy order of 400 shares is transmitted at a starting price of $5.00. Upon execution, a SELL order for 400 shares will be submitted at $7.00 (component price + profit offset). Simultaneously, the next buy order for 400 shares will be set at $4.95 (due to the 0.05 price increment). After the next component executes, another sell order for 400 shares goes out at $6.95 ($4.95 + $2.00 offset), and the next buy component is placed at a lower price level. This cycle continues until all components fill or the order is canceled.
Restore Size
As mentioned, submitting an order with only a profit offset means the algorithm buys and sells at each price level once and stops.
Let's instruct the algorithm to restore order size after taking profit. It will attempt to rebuy shares sold for profit at their original buy price, allowing repeated buy/sell execution in a volatile market like a market maker. This strategy is most effective with small price increments and profit offsets. Let's change the profit offset from $2.00 to 20 cents.
In this case, the algorithm remains active as long as the stock price stays within the range defined by (max price + price offset) and min price.
Here is how the algorithm operates with profit taking and size restoration enabled (ignoring size randomization for this example). The first 400-share buy order goes out at a starting price of $5.00. Upon fill, a SELL order goes out at $5.20 ($5.00 + 0.20 offset). Simultaneously, the next 400-share buy order is set at $4.95 (0.05 increment). This matches our previous profit offset example. However, when the $5.20 profit order fills, the second $4.95 buy component is canceled, and its size restores at the original price level, transmitting a new 400-share buy order at $5.00. Alternatively, if the $5.20 profit order does not fill but the $4.95 buy fills, a sell order is created at $5.15; if that fills, size restores at $4.95.
This feature keeps the algorithm active as long as price difference fluctuates within the designated price range.
After configuring all parameters, we can transmit the scale order.
Verify time in force and other settings are correct.
Use buttons at the bottom to preview and transmit the order.
Monitor order progress using the ScaleTrader tab.
Easily modify settings; changes take effect only after clicking "Transmit".
Manually start and stop using control buttons.
If the algorithm stops and requires a restart, check "Restart ScaleTrader" and enter initial position values that were filled when the algorithm stopped. If price difference has moved significantly from when it stopped, ScaleTrader might over-buy or over-sell, impacting the market. Correct this by adjusting the starting price after launch, then gradually returning to the original target using automatic price adjustment features.
Conclusion
Today we reviewed ScaleTrader through a simple scale order and a more complex pair order. Remember ScaleTrader supports all products except mutual funds. For both order types, we used the profit-taking feature to submit opposite orders for client-specified profit capture. We also enabled size restoration to allow ongoing profitable buy/sell execution while price (or pair price difference) stayed within range boundaries defined by price increments and profit offsets.
SCALE TRADER for pairs is an ideal tool for managing LONG/SHORT PORTFOLIOS.
Scale trading can be a highly profitable strategy if you are comfortable holding the designated maximum position should price decline to that level or below. Conceptually, it is similar to option writing—a suitable strategy if you are satisfied acquiring the underlying position upon exercise. As always, test ScaleTrader features first in PaperTrader or TWS Demo.
1. Simple – create a simple trade on an individual underlying to help you buy assets at the lowest price in a narrowing low-demand market, sell in a broad market, or build a long position.
2. Pair – create a strategy for two related stocks (essentially a stock-to-stock combination) where you buy one stock and sell the other based on the price difference between them.
3. Combo – create a standard or well-known multi-leg strategy to trade stock, option, or futures combinations.
In this webinar, we will cover simple trades and then pair trades in ScaleTrader. Although today we will focus on selling, everything discussed applies in reverse and across various products.
image missing https://guild.masters.trade/images/forum/tws_tools/scaletrader1.png
Overview of ScaleTrader
As our first example, we will create an order to buy shares of a stock we believe is near a price bottom. ScaleTrader will execute purchases as the stock price approaches a historic low and sell it when it recovers, then buy again during the next dip. This is known as "scale trading".
As you know, there are several convenient ways to open every tool in TWS. Today we will start from the Mosaic workspace, which we hope will become the main starting point for clients in the future. We promote Mosaic as IB's all-in-one interface for research, analytics, and order creation, powered by IBIS and customizable market data subscriptions. ScaleTrader can be opened via the New Window drop-down menu. As you can see, scrolling down to the very bottom and selecting More Advanced Tools places ScaleTrader at the top of the list. Instead, we will start from the Mosaic Market Scanner, which allows searching for stocks trading near the bottom of their price range.
Mosaic does not have a prebuilt 52-week High/Low scanner that we need, so I will quickly create one. In the Watchlist Plus window in Mosaic, click the "New Tab" button and select "Market Scanner". Create a custom scanner and choose 52-Week High and 52-Week Low fields from the "Add Field" list under the "Fields & Filters" section. I will place the "52-Week Low" field next to the "Last" field to easily identify stocks whose 52-week low is closest to their current last price. Once the desired symbol is found, right-click it, select "Trade", choose the order ticket, and open ScaleTrader from the Scale tab.
Simple Scale Order
ScaleTrader always opens on the "Simple" tab, which is where we will begin today. The algorithm includes two additional tabs: "Pair" and "Combo". First, we will create a simple scale order to learn the basics, then switch to the "Pair" tab to create a pair algorithm.
By default, the action is set to "Buy", so we will leave it as is.
Now we enter the maximum position value—the total number of shares we wish to accumulate during price dips (enter 10,000). Keep in mind that the value in this field applies specifically to the position within this algorithm instance.
Since we do not want to submit an order for all 10,000 shares at once, we need to specify component sizes for transmission. Initial size is the number of shares you want to buy at the starting price; subsequent size is the number of shares the algorithm will purchase at each subsequent lower price level (determined by the price increment). We will set both initial and subsequent component sizes to 400 shares. We will also use the size randomization feature so the algorithm remains undetected in the market. With a base component size of 400, randomized transmitted components can range between 200, 300, 400, 500, or 600 (plus/minus 55% rounded to the nearest hundred).
Enter the starting price and price increment. We will set the bid as the starting price and 2 cents as the price increment. This means each subsequent purchase component price will be 2 cents lower.
Now look at the calculated maximum and minimum prices. Since our initial and subsequent sizes are identical, the starting price and top price coincide. If the initial size were larger, the top price would exceed the starting price by the difference between subsequent and initial component sizes, multiplied by the price increment. For example, if we set 800 as the initial component size (twice the subsequent size of 400), the starting price would be 2 x 0.02 or 4 cents higher than the base price. This is relevant mainly when using ScaleTrader for selling off a position. Detailed information can be found in the "TWS User Guide".
Minimum price is the price at which the final buy order will execute if the price drops to the bottom of the range. When modifying the minimum price, notice that the price increment adjusts automatically to compensate. You can adjust prices manually or by dragging lines on the chart.
Now select the order type: Limit or Relative. If we use a Relative order with zero offset, orders will always be pegged to the bid, even when the increment specifies a higher price. Adding an offset of 0.01 makes our bid one penny higher than NBB, provided it is equal to or lower than the next scale price level. Using a penny offset increases execution chances, though execution may occur at a slightly less favorable scale price.
Profit Offset
At this stage, we could transmit a basic scale order, and ScaleTrader would attempt to reach our max position and stop. Traders often use this strategy to build a long position.
However, that is not our goal here. We can sell during periodic price spikes or liquidate our position upon reaching a target profit level by creating profit-taking orders and setting a profit offset.
Profit offset is the amount of profit we want to capture on the exit trade. Setting a 20-cent offset means the first sell order will be submitted at a price 20 cents higher than the first buy component price. A key detail: if a buy order executes at a price higher than the peg reference price, the corresponding sell order price will still be determined using the static price increment; the sell price is not adjusted based on actual execution price. We capture additional profit every time the stock price fluctuates.
As the stock rises, the position will be sold off in subsequent component sizes at price increments defined during the buy phase. The final sale will take place at the highest price plus the 20-cent profit offset.
Restore Size
If we submit an order with only a profit offset configured, the algorithm will buy and sell at each price level only once and then stop.
However, there is also a "Restore Size After Taking Profit" feature. This means the algorithm will attempt to rebuy shares sold for profit at the price they were originally bought. This allows us to repeatedly buy and sell in a volatile market, acting like a market maker. This strategy works best when setting relatively small price increments and profit offsets. Let's change the profit offset from 20 cents to 4 cents.
In this case, the algorithm will remain active as long as the stock price stays within the range defined by (max price + price offset) and the minimum price.
Creating Pair Trades
Now let's examine creating pair trades. Pair trading in ScaleTrader involves trading the price difference of a non-guaranteed two-leg stock/stock combination. Once the pair is selected, we treat the price difference just like an individual stock price in a simple trade.
Today we will look at a pair trade using two stocks that historically showed a close price correlation—in this case, Wal-Mart and Target—where prices have diverged. We will buy the higher-priced stock as its price dips and sell the lower-priced stock as its price rises, executing this as a two-leg combination we purchase. Although we describe a buy transaction, all principles apply in reverse and across different products.
First, open the "Pair" tab and select "Edit Pair". Now we enter ticker symbols for both legs. We configure parameters to buy the higher-priced stock and sell the lower-priced stock, which we consider mispriced relative to each other.
Net Amount is the difference between legs (leg size x price difference), while Price Difference reflects underlying price divergence. We will select Price Difference and click Create to generate the pair.
Note that IB cannot guarantee this combination. This means there is a slight possibility of executing only one leg of the pair. If this happens, the second leg order may execute at a less favorable price, though you will not be left with an unhedged position.
Now let me highlight the ScaleTrader chart. You might think the chart displays both tickers in our combination, but it actually shows the price difference between them, which is what we are trading. You can change the chart timeframe to view 3-month, 6-month, or 1-year history.
Creating Pair Orders
Core order parameters here are similar to those in our first example. We will create a buy order. Notice that when creating a pair, the component size field precedes the max position field.
Component Size – 400 each.
Note that using equal values keeps the combination ratio at 1:1; altering share quantities changes this ratio. This ratio must match the ratio in max position fields.
Max Position – 50,000 each. Use size randomization so the algorithm remains undetected. With component sizes of 400, transmitted components can be 200, 300, 400, 500, or 600, while avoiding minimum commission surcharges.
This maximum applies only to this algorithm instance; your overall portfolio position may differ.
Use size randomization so the algorithm remains undetected. With component sizes of 400, transmitted components can be 200, 300, 400, 500, or 600, avoiding minimum commission surcharges.
Enter starting price. For example, if the combination price difference is 4.75, set 4.70 as the initial bid price. Treat the price difference just like an individual asset price. Price Increment – set to 0.05.
Price can be set manually or by dragging the "starting price line" on the chart.
Notice that max and min prices are calculated automatically. Adjust the min price by moving the line on the chart and note the automatic recalculation of the price increment.
Order Types – these combination order types are designed to maximize execution chances for both legs (since it is a non-guaranteed order).
LMT + MKT – both legs submitted as limit orders. If only one executes, the second converts to a market order.
REL + MKT – both legs submitted as relative orders (pegged to buy bid or sell ask). If only one executes, the second resubmits as a market order.
Profit-Taking Order
While we could transmit an order with only these parameters, we want to achieve more. We will continue configuring parameters to instruct the algorithm to buy and sell, capturing value from market fluctuations.
First, we create a profit-taking order instructing the algorithm to send an opposite order—in this case, a sell order after current buy execution. As with basic orders, profit order pricing is based on component price plus profit offset, not actual execution price.
Let's enable this feature and set a profit offset of 2.00. Now let's walk through an example. For simplicity, we ignore size randomization. Suppose the first buy order of 400 shares is transmitted at a starting price of $5.00. Upon execution, a SELL order for 400 shares will be submitted at $7.00 (component price + profit offset). Simultaneously, the next buy order for 400 shares will be set at $4.95 (due to the 0.05 price increment). After the next component executes, another sell order for 400 shares goes out at $6.95 ($4.95 + $2.00 offset), and the next buy component is placed at a lower price level. This cycle continues until all components fill or the order is canceled.
Restore Size
As mentioned, submitting an order with only a profit offset means the algorithm buys and sells at each price level once and stops.
Let's instruct the algorithm to restore order size after taking profit. It will attempt to rebuy shares sold for profit at their original buy price, allowing repeated buy/sell execution in a volatile market like a market maker. This strategy is most effective with small price increments and profit offsets. Let's change the profit offset from $2.00 to 20 cents.
In this case, the algorithm remains active as long as the stock price stays within the range defined by (max price + price offset) and min price.
Here is how the algorithm operates with profit taking and size restoration enabled (ignoring size randomization for this example). The first 400-share buy order goes out at a starting price of $5.00. Upon fill, a SELL order goes out at $5.20 ($5.00 + 0.20 offset). Simultaneously, the next 400-share buy order is set at $4.95 (0.05 increment). This matches our previous profit offset example. However, when the $5.20 profit order fills, the second $4.95 buy component is canceled, and its size restores at the original price level, transmitting a new 400-share buy order at $5.00. Alternatively, if the $5.20 profit order does not fill but the $4.95 buy fills, a sell order is created at $5.15; if that fills, size restores at $4.95.
This feature keeps the algorithm active as long as price difference fluctuates within the designated price range.
After configuring all parameters, we can transmit the scale order.
Verify time in force and other settings are correct.
Use buttons at the bottom to preview and transmit the order.
Monitor order progress using the ScaleTrader tab.
Easily modify settings; changes take effect only after clicking "Transmit".
Manually start and stop using control buttons.
If the algorithm stops and requires a restart, check "Restart ScaleTrader" and enter initial position values that were filled when the algorithm stopped. If price difference has moved significantly from when it stopped, ScaleTrader might over-buy or over-sell, impacting the market. Correct this by adjusting the starting price after launch, then gradually returning to the original target using automatic price adjustment features.
Conclusion
Today we reviewed ScaleTrader through a simple scale order and a more complex pair order. Remember ScaleTrader supports all products except mutual funds. For both order types, we used the profit-taking feature to submit opposite orders for client-specified profit capture. We also enabled size restoration to allow ongoing profitable buy/sell execution while price (or pair price difference) stayed within range boundaries defined by price increments and profit offsets.
SCALE TRADER for pairs is an ideal tool for managing LONG/SHORT PORTFOLIOS.
Scale trading can be a highly profitable strategy if you are comfortable holding the designated maximum position should price decline to that level or below. Conceptually, it is similar to option writing—a suitable strategy if you are satisfied acquiring the underlying position upon exercise. As always, test ScaleTrader features first in PaperTrader or TWS Demo.
Connexion ou Créer un compte pour participer à la conversation.
Temps de génération de la page : 0.065 secondes

