Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 02:25:30 +0000



Trade Management by Study - delay required

View Count: 543

[2021-09-19 16:40:02]
User183843 - Posts: 12
I am using the value available in Spreadsheet field J48 ( Last Entry Fill Price (read-only)) of my "Spreadsheet study" spreadsheet.

This value is used to calculate TP and SL. The calculated values are then applied using "Trade Management by Study" study.
Limit Orders (with attached SL/TP) are set manually for this example.

In the moment the order is executed, the study is setting SL/TP according to my calculation.
Unfortunately it still uses the previous value that was present in the field J48 which leads to incorrect SL/TP.


So, it seems like the Study is doing it's work before the spreadsheet J48 field is updated.

Is there any way to introduce a delay (e.g. 1s), to stop "Trade Management by Study" modifying TP/SL with incorrect values in the moment the limit order is executed, or another idea to fix it?
Date Time Of Last Edit: 2021-09-19 16:45:45
[2021-09-19 17:27:58]
John - SC Support - Posts: 31362
Make sure the Trade Management by Study studies are below the Spreadsheet study in your Studies To Graph list.

How do you have the "Trade Management by Study" Input for "Order Adjustment Timing" set? If it is set to "Every N Seconds", then you should have that delay in seconds before it makes the first adjustment to the Target/Stop. Refer to the following:
Attached Orders: Trade Management by Study Input Settings
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-09-19 18:44:02]
User183843 - Posts: 12
thanks for the quick answer.

Yes, I have considered both points.
Are the Study Id's relevant or the order in the "Studies to Graph list"?

The study is definitely adjusting TP/SL before the time set in the "Every N seconds" (I have set it to 10s),
I can see the set value in the message log at the time of order execution.

After the first 10s, the orders are correctly adjusted.
[2021-09-19 20:47:13]
Sawtooth - Posts: 3993
The study is definitely adjusting TP/SL before the time set in the "Every N seconds" (I have set it to 10s)
The "Every N seconds" setting will use the first intrabar value in the current bar, then update N seconds later.
Attached Orders: Trade Management by Study Input Settings

Try using J80/J81 to set the offsets, as these offsets are relative to the parent order price.
(Note: The J80/J81 offsets are in points, not ticks.)
Spreadsheet Systems, Alerts and Automated Trading: Attached Order Target Offset (write only) [J80]
Date Time Of Last Edit: 2021-09-19 20:47:40
[2021-09-20 19:55:19]
User183843 - Posts: 12
thanks, tomgilb, for the tip to use J80/J81. This does not answer my issue, but helps me with another topic.

The "Every N seconds" setting will use the first intrabar value in the current bar, then update N seconds later.
I am wondering nobody had any issue with that behaviour before.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account