c# - Array evaluation -


newbie c#, programming in ninjatrader , need develop simple function performs following:

  1. i need check see if stocks high price higher price before, done indexing. such high[0] > high[1] (as 0 being current price).
  2. if current price higher needs set indexed variable (array guessing) if high[0] > high[1] variable = high[0].
  3. the next evaluation , stuck how evaluate if current high price greater each element in array. meaning price increasing.
  4. once price no longer increasing output of function need highest of high prices in array.

  5. thanks can help!

ben

3)

if (high.all(x => currenthighprice > x)) { ... } 

4)

var highest = high.max(); 

but both options use linq. if that's not option, use for/foreach loop.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -