Skip to content

Instantly share code, notes, and snippets.

@rupeshtr78
Created October 29, 2020 01:06
Show Gist options
  • Save rupeshtr78/f3eb8677738ed134cd12bbe48b7ebe3e to your computer and use it in GitHub Desktop.
Save rupeshtr78/f3eb8677738ed134cd12bbe48b7ebe3e to your computer and use it in GitHub Desktop.
patternmatching
val bullFlag = stockRecord.close match {
case stockRecord.close if (previousState.bullFlag == 1 && stockRecord.close >= previousState.lowClose) => 1
case stockRecord.close if ((stockRecord.close > highOfLowClose) && stockRecord.candle == 1) => 1
case _ => 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment