Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 02:03:57 +0000



Help with creating "Stop Graph" in custom study

View Count: 672

[2015-12-11 06:01:29]
cazeek - Posts: 33
Hello, I apologize in advance that this may be a bit complicated. I am just starting figuring out how to code a study.

I need two lines in my chart to indicate where my stops are. The rule is:

Once BUY is entered, I will need two lines representing the stop levels:

LINE 1:
Stop1 (trailing, recalculated daily): Maximum(ClosePrices(tradedate -> today)) - 4 x Average True Range
Stop2 (fixed): Open Price - 3 x Average True Range
I want first line graphed to show whichever is greater, Stop1 or Stop2.

This line will be a stop that is 3 ATRs below the open price of the BUY date. Once the close price - 4 ATRs is greater, the stop will move up with the value of that. One other condition is I don't ever want the Stop price to move down. So if ATR spikes and causes close price - 4 ATRs to be lower than the day before, I want to use the prior highest stop.

Essentially, I just want a fixed stop that eventually turns into a trailing stop.

The second line will be a little different, but if you can help me with this one, I will be able to figure it out.

Thanks so much
[2015-12-11 17:41:32]
Sierra Chart Engineering - Posts: 104368
This question is not within the scope of Sierra Chart support.

We can only refer you to the custom programming documentation for ACSIL and Spreadsheets here:
Advanced Custom Study Interface and Language (ACSIL)
https://www.sierrachart.com/index.php?page=doc/doc_SpreadsheetStudy.html
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