Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 03:40:58 +0000



Current Price Study > Displacement

View Count: 789

[2023-08-25 06:18:31]
Piotr Grzegorzek - Posts: 21
In the Current Price Study there is a "Displacement" possible but only to the right.

When Im trading I only open a position if the Candle Formation is not bigger than a surrten amount of tics.
I would like to offset one Study up and another down to see the maximal Stop Loss that I use.

Could you please add this function to this study?

Thanks
imageCurrent Price Study 1.JPG / V - Attached On 2023-08-25 06:13:04 UTC - Size: 159.57 KB - 128 views
[2023-08-25 14:57:18]
John - SC Support - Posts: 36309
The Current Price Line has an Input called "Number of Bars Back to Reference". This will let you get a line for the Input Data for a previous bar. Refer to the following:
Current Price Line
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-08-25 16:27:04]
Piotr Grzegorzek - Posts: 21
I think I was not clear enough.

I need this study applied three times:
- on the current price
- 22 tick above the current price
- 22 tics below the current price
see picture.

Than I can see if the candle formation is not bigger than 22 tics.
imageCurrent Price Study 2.JPG / V - Attached On 2023-08-25 16:25:35 UTC - Size: 110.49 KB - 109 views
[2023-08-25 17:33:17]
John - SC Support - Posts: 36309
If you are wanting the offset value to always be 22 ticks, regardless of the tick size of the chart (if you are changing the symbol of the chart), then the best way to do this is to use either a Spreadsheet or the Spreadsheet Formula for the lines above/below the Current Price.

If you use the Spreadsheet Formula, you would use two copies, one to create a line above and a second for the line above. The formula you would enter for the line above would be the following:
=ID1.SG1 + 22 * TICKSIZE

Where ID1 is the ID of the Current Price Line study. You may need to change the number to match your actual Current Price Line study.

If you use the Spreadsheet Study, then you just need one copy and you will use two columns to create the lines. Note that the syntax for entering formulas is different between the Spreadsheet Formula (which uses the Alert Syntax) and the Spreadsheet (which uses Spreadsheet Syntax).

Refer to the following for reference:
Spreadsheet Formula

Study/Chart Alerts And Scanning: Referencing Other Studies on the Chart

Using the Spreadsheet Study

Working with Spreadsheets: References to Study Subgraph Columns when using the Spreadsheet Study
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-08-28 09:44:10]
Piotr Grzegorzek - Posts: 21
This will draw lines on the chart and leave them there. This will clutter the chart.

What is needed is only the last price offset up and down by a certain amount of tics.
The addition of this function to the Current Price Study would be very helpful.

Can you provide this functionality?
[2023-08-28 16:42:21]
John - SC Support - Posts: 36309
This does not draw a line and leave it there. The lines will move with the Current Price Line.

The only thing we did not specify is that you need to set the "Spreadsheet Formula" study to be in Region 1, if that is your issue.

The other thing is that you can set the number of bars to calculate on the Spreadsheet Formula to match how far back you have the Current Price Line.

And if you need to extend the Spreadsheet Formula into the Forward Projection Area like the Current Price Line, then use the "Forward Projection Bars" study with the "Based On" set to the "Spreadsheet Study" and the "Graph Draw Type" on the Subgraphs tab to "Line on Open". Then set the Open subgraph to match the Spreadsheet Formula.

The point of the above is really to point out that there is typically a way to accomplish what you want within Sierra Chart. You can even modify the code for most studies - including the "Current Price Line" study, which is in the "Studies3.cpp" file in the ACS_Source folder under the main Sierra Chart installation folder on your system.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-09-18 08:32:30]
Piotr Grzegorzek - Posts: 21
I added studies:
- Current Price Line
- Spreadsheet Formula
picture 1

The Spreadsheet Formula is set to =ID2.SG1 + 22 * TICKSIZE (picture 2)
But the line is at 0.
Changing the 22 to a different number doesn't change anything (see picture 3).
image1.JPG / V - Attached On 2023-09-18 08:28:09 UTC - Size: 74.52 KB - 108 views
image2.JPG / V - Attached On 2023-09-18 08:28:17 UTC - Size: 72.65 KB - 113 views
image3.JPG / V - Attached On 2023-09-18 08:31:49 UTC - Size: 104.76 KB - 106 views
[2023-09-18 14:44:03]
Sawtooth - Posts: 4120
In the Spreadsheet Formula study:
- Set Draw Zeros to No.
- Set 'Number of Bars To Calculate' to <= the 'Number of Bars to Display' in the Current Price Line study.
[2023-09-18 15:52:51]
Piotr Grzegorzek - Posts: 21
When
"Number of Bars to Calculate" set to 1 see picture 4
"Number of Bars to Calculate" set to 0 see picture 5
still its not working.
image4.JPG / V - Attached On 2023-09-18 15:50:44 UTC - Size: 176.55 KB - 104 views
image5.JPG / V - Attached On 2023-09-18 15:50:53 UTC - Size: 170.17 KB - 93 views
[2023-09-18 16:17:51]
Sawtooth - Posts: 4120
In the Spreadsheet Formula study, set the Number of Bars to Calculate to 10
In the Current Price Line study, set the Number of Bars to Display to 10
[2023-09-19 07:08:25]
Piotr Grzegorzek - Posts: 21
I did the change in setting (see picture 6 and 7) but it's not working properly.
Also now the lines cover the candles but they should be shown only after the last candle.
image6.JPG / V - Attached On 2023-09-19 07:08:02 UTC - Size: 165.51 KB - 96 views
image7.JPG / V - Attached On 2023-09-19 07:08:13 UTC - Size: 146.79 KB - 72 views
[2023-09-19 14:44:14]
Sawtooth - Posts: 4120
See attached chartbook for an example of how to do this.
attachmentCPL envelope.Cht - Attached On 2023-09-19 14:44:04 UTC - Size: 4.38 KB - 206 views
[2023-09-22 12:36:46]
Piotr Grzegorzek - Posts: 21
Thanks, it works now.

There is a new thing.
The chart shifts with every tick change. It is very annoying. Can it be switched of? Without this Study the chart doesn't move up or down with every tick change.
Private File
[2023-09-22 13:03:31]
Piotr Grzegorzek - Posts: 21
With only the Current Price Line study visible it doesn't do that but wen I make the Spreadsheet Formula visible the chart moves up and down with every thick.
[2023-09-22 14:02:01]
Sawtooth - Posts: 4120
The chart shifts with every tick change. It is very annoying.
In all 5 studies, set the Scale to 'Same As Region'.

-Highlight a study in the Studies to Graph list
-Click on the Settings button
-Click on the Scale button
-Choose 'Same as Region'
-Repeat for all 5 studies in that chartbook.

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

Login

Login Page - Create Account