NexusFi: Find Your Edge


Home Menu

 





[SC] Overlay a study, but only at bar open


Discussion in Sierra Chart

Updated
    1. trending_up 2,785 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 2 attachments




 
Search this Thread

[SC] Overlay a study, but only at bar open

  #1 (permalink)
 
Nicolas11's Avatar
 Nicolas11 
near Paris, France
 
Experience: Beginner
Platform: -
Trading: -
Posts: 1,071 since Aug 2011
Thanks Given: 2,232
Thanks Received: 1,769

@ejtrader,

As previously discussed, I have understood that you want to overlay a study on a chart, but you only want the update to be done at the open of the bar.

You could test the following:
  • Open a 1-tick chart (or any quick chart).
  • Apply study "Bar Number (modulo 10)" to this 1-tick chart. This study simply plots the Bar Number of each bar (modulo 10). So we are sure that the value of the study changes at each tick.
  • Open a 6-range chart (or any kind of chart)
  • Apply study "Overlay only at bar open" to the 6-range chart. Check in the input tab that the study to overlay is the "Bar Number (modulo 10)" of 1-tick chart.

Normally, you will see that the overlaid study just updates at each 6-range open.

How does it work?
The 6-range study is updated only when sc.Index is different from the value of sc.Index at last call (known through the use of a persistent variable).

Two drawbacks:
(i) I do not know if SC systematically calls studies at the opening of new bar. If no, there could be a very short time difference between the actual open of the bar and the first call to the study. This time difference is 500ms or any shorter value defined by the user in Global Settings > General Settings
(ii) The correspondence between 1-tick chart and 6-range chart is made with function sc.GetContainingIndexForDateTimeIndex, which is not precise to the tick (timestamp effect). EDIT: This time difference is 1s maximum.

Perhaps it does not answer 100% to your need, but it could give you ideas.

Nicolas


Attached Files
Elite Membership required to download: ejtrader.cpp
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Futures True Range Report
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #3 (permalink)
 ejtrader 
Portland, OR
 
Experience: Intermediate
Platform: Sierra Chart
Trading: ES
Posts: 269 since Jan 2011
Thanks Given: 327
Thanks Received: 180


Thanks a lot Nicolas. Appreciate it. I am going to give this a try and let you know how it goes.

Reply With Quote
  #4 (permalink)
 ejtrader 
Portland, OR
 
Experience: Intermediate
Platform: Sierra Chart
Trading: ES
Posts: 269 since Jan 2011
Thanks Given: 327
Thanks Received: 180

Nicolas - After initial review - this seem to be the perfect solution I was looking for.

Would expand further on this framework and reply if I have any further questions on this subject.

Thanks

Reply With Quote
Thanked by:




Last Updated on August 13, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts