Login Page - Create Account

Support Board


Date/Time: Thu, 16 May 2024 12:25:24 +0000



Spreadsheet Automated Trading: Targets and Stops

View Count: 4526

[2014-07-15 13:22:10]
User60737 - Posts: 6
I have a stop loss that I would like to do the following:

-stop loss starts x amount of ticks below position

-after x amount of positive ticks move to break even

-after x amount of positive ticks after that trail a moving average

**I also would like a condition where if a moving average crosses flatten the position

I am confused as to how to do this within the spreadsheet. Am I able use the buy and sell exit columns or should I leave blank and use the trade order window (or both)? Any assistance with the correct syntax or steps to enter in the trade window would be much appreciated. Thanks!
[2014-07-15 17:13:31]
Sawtooth - Posts: 3997
1) On the Trade Window Targets tab, choose Move To Breakeven for Stop >> Trail to Breakeven Offset Triggered, and set parameters. Check 'Use Attached Orders'.
https://www.sierrachart.com/index.php?page=doc/doc_AttachedOrders.html#MoveBreakevenForStop

2) Put your MA crossover flatten formula in J29. For close of bar, reference row 4, for intrabar, reference row 3.
Close of bar example:
=OR(AND(J8>0,AA5>AC5,AC4>AA4),AND(J8<0,AA5<AC5,AC4<AA4))
Intrabar example:
=OR(AND(J8>0,AA4>AC4,AC3>AA3),AND(J8<0,AA4<AC4,AC3<AA3))
where AA is the faster MA and AC is the slower MA.

3) In the spreadsheet study settings, set Cancel All Working Orders on Exit to Yes. This allows both spreadsheet exits and Attached Orders exits.
Date Time Of Last Edit: 2014-07-15 19:40:59
[2014-07-15 19:11:32]
Sierra Chart Engineering - Posts: 104368
We do not recommend using a Spreadsheet for this. It cannot be done since Spreadsheets cannot modify stop orders. Unless you were to not use a Stop order and instead just use the Exit cells to send a market order when you want to exit.

If you do not use Spreadsheets, we recommend using ACSIL trading:
https://www.sierrachart.com/index.php?page=doc/doc_ACSILTrading.html


Also in the prior post there is a reference to Move To Breakeven for Stops documentation, but that will do nothing unless you are using Attached Orders.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2014-07-15 19:15:35
[2014-07-15 20:11:30]
Sawtooth - Posts: 3997
Oops, I missed that the OP wants to trail the MA.

However, this should be possible using the Trade Management by Study study referencing a spreadsheet subgraph. So with this additional study, a spreadsheet could modify stop orders.


[2014-07-18 07:27:19]
Sierra Chart Engineering - Posts: 104368

However, this should be possible using the Trade Management by Study study referencing a spreadsheet subgraph. So with this additional study, a spreadsheet could modify stop orders.

Yes. This is true. Here is the documentation for Trade Management by Study:
https://www.sierrachart.com/index.php?page=doc/doc_AttachedOrders.html#StudyControlledTargetsStops
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2014-07-18 07:27:44
[2014-09-11 22:08:09]
GaryD - Posts: 61
I am trying to get a profit target to follow a moving average, and it will as price moves towards the target, but as price moves away from the target it jumps back to the "Use Attached Orders" setting. How do I get a target to just stick to a moving average using Trade Management By Study?
[2014-09-12 16:56:10]
User120827 - Posts: 77
how do you get the target t follow moving average ? sounds cool
[2014-09-12 17:31:47]
Sierra Chart Engineering - Posts: 104368
When you say it "jumps back", what is causing that?

That will be clearly indicated in the Trade >> Trade Activity Log:
https://www.sierrachart.com/index.php?page=doc/doc_TradeActivityLog.php

Look at the Order Action Source for the order modification.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2014-09-12 17:32:41]
Sierra Chart Engineering - Posts: 104368
how do you get the target t follow moving average ? sounds cool
For this, refer to:
https://www.sierrachart.com/index.php?page=doc/doc_AttachedOrders.html#StudyControlledTargetsStops
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2014-09-12 22:36:03]
GaryD - Posts: 61
"When you say it "jumps back", what is causing that?"


What it was doing was, let's say the moving average was 50 ticks away, but the OCO attached orders was set to 20 ticks. The profit target would initially appear at 20 ticks away, then go to the moving average at 50 ticks away, but then at the next bar close go back to the original location of 20 ticks away and then stop following the MA.


I did not look into the log as I figured out how to stop it. My trade window is not attached in my standard workspace, and the one I was using to enter the trade was from another chart. Once I opened a trade window in the chart that had the "Trade Management By Study" on it, it works as designed. I played with it some today, the orders from the correct chart work, but if I add from another chart those are ignored.

Sierra is great and has what I need already built in almost every time I look hard enough. :) Thanks.

[2014-09-12 22:40:33]
GaryD - Posts: 61
Also, the Support Scale In/Out has to be selected for additional entries to follow along.
[2014-09-13 03:57:00]
Sierra Chart Engineering - Posts: 104368
I played with it some today, the orders from the correct chart work, but if I add from another chart those are ignored.


Not sure why this would be a problem, but unless we see exactly what you are doing, see the open orders, and look at the log messages from the Trade Management by Study, it is hard for us to comment on this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account