Count the instruments if....

Discussions about the testing and simulation of mechanical trading systems using historical data and other methods. Trading Blox Customers should post Trading Blox specific questions in the Customer Support forum.
Post Reply
872251950
Contributing Member
Contributing Member
Posts: 8
Joined: Wed Dec 11, 2013 2:09 pm

Count the instruments if....

Post by 872251950 »

Hello everyone,

Really confusing if there is a function to count instruments that meet certain criteria, maybe something like a countif function in Excel. Or is there a loop I could use to do counting? Let's say count how many contracts have ROC in close price greater than "0" ?

Here is my rough thought but I think something wrong with it.

Count= 0
For i= 1 to system.totalinstruments

if instrument.close(ROC)> 0 then
count=count+1
end if
next

Appreciate for any help.
Post Reply