Login Page - Create Account

Support Board


Date/Time: Wed, 07 May 2025 15:07:25 +0000



recalculation infinite loop if chart contains 1 bar

View Count: 200

[2024-11-28 20:07:43]
seandunaway - Posts: 348
if the chart contains only 1 bar there is a silent recalculation infinite loop, causing ui glitching and preventing any custom study from submitting orders

e.g. a chart with 1 days to load and 1-0-0-0 bar period

have a minimum of 2 bars to resolve

documenting incase anyone else runs into this in the future; it's a proper headache to diagnose


keywords: sc.IsFullRecalculation, SCT_SKIPPED_FULL_RECALC, Order entry skipped because full recalculation
Date Time Of Last Edit: 2024-11-28 20:54:50
[2024-11-28 22:24:01]
Sierra_Chart Engineering - Posts: 19468
This is not making any sense. There is no infinite loop. There could not be any user interface problem either with this.

There must be something, your custom study is doing that is causing a problem.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2024-11-28 22:24:21
[2024-11-28 23:38:59]
seandunaway - Posts: 348
please check that an intraday chart with 1 bar (e.g. 1 days loaded and 1 day bar period) is in constant recalculation

#include <sierrachart.h>

SCDLLName("recalc")
SCSFExport scsf_recalc(SCStudyInterfaceRef sc) {
  if (sc.SetDefaults) {
    sc.AllowOnlyOneTradePerBar = 0;
    sc.GraphName = "recalc";
    sc.GraphRegion = 0;
    sc.UpdateAlways = 1;
    return;
  }

  if (sc.IsFullRecalculation) return; // !
  if (!sc.GetCustomStudyControlBarButtonEnableState(2)) return;

  s_SCNewOrder order;
  order.OrderQuantity = 1;
  order.OrderType = SCT_ORDERTYPE_MARKET;

  int result = sc.BuyEntry(order);
  if (result < 0) sc.AddMessageToTradeServiceLog(sc.GetTradingErrorTextMessage(result), 1, 1);

  sc.SetCustomStudyControlBarButtonEnable(2, 0);
}

animated gif attached
Date Time Of Last Edit: 2024-11-29 00:39:40
imagerecalc.gif / V - Attached On 2024-11-28 23:38:53 UTC - Size: 2.53 MB - 47 views
[2024-11-28 23:57:15]
seandunaway - Posts: 348
adding more than one bar resolves

animated gif attached
imagerecalc_fixed.gif / V - Attached On 2024-11-28 23:57:04 UTC - Size: 2.03 MB - 43 views
[2024-11-29 01:28:23]
Sierra_Chart Engineering - Posts: 19468
There is not a constant recalculation. This is not possible. It is just that the Full Recalculation flag is always true every time the study is calculated according to the standard rules.
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, use 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