I was reading through their examples and I don't understand
why Every Trading System needs a loop? I'm a C/C++ programmer so it's not the language I don't understand.
What is the loop for?
Can't you say to just use the 15 SMA for the current bar?
Also, is Bar variable integer the current bar?
Bar + 1, is that the next bar?
If Bar is 30 to barcount - 1,
What does that go up to? How many bars are in barcount?
Thanks for any information you can help me with.
****
Every Trading System must have a main loop that cycles through the data in your chart. This is accomplished with a typical "for loop", as shown below:
Example
var BAR: integer;
{ ChartScript Main Loop }
for Bar := 30 to BarCount -1 do
begin
{ Trading rules go here, and are executed once for every bar in the chart }
end;
Here, the for loop starts at the 30th bar of data. You should set your main loop's starting point based on the technical indicators that you're using. For example, if you use a 30 bar EMA and a 14 bar RSI in your rules, choose the longer of the two indicators and set your starting for loop value to 30. The main loop typically ends at BarCount - 1;
***
why Every Trading System needs a loop? I'm a C/C++ programmer so it's not the language I don't understand.
What is the loop for?
Can't you say to just use the 15 SMA for the current bar?
Also, is Bar variable integer the current bar?
Bar + 1, is that the next bar?
If Bar is 30 to barcount - 1,
What does that go up to? How many bars are in barcount?
Thanks for any information you can help me with.
****
Every Trading System must have a main loop that cycles through the data in your chart. This is accomplished with a typical "for loop", as shown below:
Example
var BAR: integer;
{ ChartScript Main Loop }
for Bar := 30 to BarCount -1 do
begin
{ Trading rules go here, and are executed once for every bar in the chart }
end;
Here, the for loop starts at the 30th bar of data. You should set your main loop's starting point based on the technical indicators that you're using. For example, if you use a 30 bar EMA and a 14 bar RSI in your rules, choose the longer of the two indicators and set your starting for loop value to 30. The main loop typically ends at BarCount - 1;
***