Login Page - Create Account

Support Board


Date/Time: Thu, 28 Nov 2024 15:37:10 +0000



[Programming Help] - not working: skip BarIndex based on study input

View Count: 285

[2023-04-20 21:18:17]
jomo88 - Posts: 47
why cant i specifiy the amount of bar indexes to skip based on an input?
first code section works, second example does not with input_VARIABLE


for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++)
  {
  
    if (BarIndex <= 100)
      {
       turn everything off (wait for moving averages to stabilize)
      }
    else
      {
       now let algo run
      }
      
  }
  
  
..... HOWEVER ....
..... the following code does not work...
...............
  
for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++)
  {
  
    if (BarIndex <= input_VARIABLE)
      {
       turn everything off (wait for moving averages to stabilize)
      }
    else
      {
       now let algo run
      }
      
  }
[2023-04-20 23:28:02]
User719512 - Posts: 267
Have you tried:

if (BarIndex <= input_VARIABLE.GetInt())

[2023-04-21 00:32:04]
jomo88 - Posts: 47
I had a bug

But thank you for making me double check, I was able to spot it

Cheers

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

Login

Login Page - Create Account