Dear TJ,
That worked, thank you. Just trying to understand the subtle difference between the two solutions provided above. Was the issue one of not re-starting the count for the counter-argument? i.e. not beginning again if the event didn't occur?
Thanks again!
Search found 4 matches
- 16 Feb 2015
- Forum: MultiCharts
- Topic: Indicator counting condition twice [SOLVED]
- Replies: 6
- Views: 1893
- 16 Feb 2015
- Forum: MultiCharts
- Topic: Indicator counting condition twice [SOLVED]
- Replies: 6
- Views: 1893
Re: Indicator counting condition twice [SOLVED]
Dear Josh, TJ, Thank you for your help. I tried the code you suggested, but the error still occurs. I've attached a picture of the problem. I've marked the inside bars with a solid yellow point. The count in the subchart after such a bar jumps to 2 then drops off to 1 the next bar (assuming no furth...
- 16 Feb 2015
- Forum: MultiCharts
- Topic: Indicator counting condition twice [SOLVED]
- Replies: 6
- Views: 1893
Re: Indicator counting condition twice [SOLVED]
Apologies, TJ:
Code: Select all
Inputs:
LookbackPeriod (10);
Variables:
IBCount(0),
SumIB(0);
SumIB= sum(IBCount,LookbackPeriod);
Condition1 = High < High[1] and Low > Low[1];
If condition1 = true then begin
IBCount = 1;
end
Else begin IBCount=0;
end;
Plot1(SumIB);
- 16 Feb 2015
- Forum: MultiCharts
- Topic: Indicator counting condition twice [SOLVED]
- Replies: 6
- Views: 1893
Indicator counting condition twice [SOLVED]
Dear All, I'm having trouble creating a simple index that records how often an event (in this case, and inside bar) has occurred over a given look back period (10). It appears to count the event twice: once correctly at the close of the bar fitting the conditions and then again in the following bar ...