Sevilla + Spain
Experience: Beginner
Platform: Multicharts
Trading: SP
Posts: 21 since May 2016
Thanks Given: 3
Thanks Received: 3
|
Hi,
I'm developing an indicator for Multucharts.NET with Powrlanguage. I have a 5 minutes chart, and I need to do the following in calcbar() method.
Lets say it is 9:00 AM. The time of current bar is 9:00 AM. I need to sum the close price of all 9:00AM bars of last 10 days.
I have the following code:
Sum = 0
for (count = 1; count < 2880; count++){
if (bars.time[count] == bars.time[0]){
Sum = Sum + bar.close[count]
}
}
Then I want to plot SUM. But it plots 0. Doesn't work. The logical condition under the if appears not to be true ever.
How could I make it work?
Note: 2280 because each day has (24 * 12) 5 minute bars, and I want 10 days back, which gives 2880 bars to analyze.
Thanks
|