I need to find a pattern, once that pattern is found I wait for a particular candle . Once that candle is found I buy shares. I am able to write the algorithm in streak to identify the pattern however not able to write the code to find the trigger candle to buy shares.
Here is the explanation for my logic
Pattern is one bullish candle followed by another bullish candle with the following condition
open(1) > open(0) and close(1) > close(0) and high(1) > high(0) and low(1) > low(0)
once this pattern is identified i need to find the next bullish candle with following condition
the high of this bullish candle is greater than ( high(1) + 10 ). This should trigger the order
This next bullish candle can be any bullish candle after the pattern is identified. But there should not be any bearish candle between the trigger candle and pattern.
You can write Period min(10, Close(0) - Open(0) ) higher than 0.0 and Period min(9, Low(-1) ) higher than Prev N(Low,-10,3min) and Period max(9, High(-1) ) lower than Prev N(High,-10,3min) and High(0) higher than Prev N(High,-10,3min)
I have rewritten my logic using the functions given by you
Period min(10, Close(0) - Open(0) ) higher than 0.0 and
Prev N(Open,-9,1hour) higher than Prev N(Open,-10,1hour) and
Prev N(Close,-9,1hour) higher than Prev N(Close,-10,1hour) and
Prev N(Low,-9,1hour) higher than Prev N(Low,-10,1hour) and
Prev N(High,-9,1hour) higher than Prev N(High,-10,1hour) and
high(0) higher than sum(Prev N(High,-9,1hour) + 10)
Basically I don’t want to hard-code the offset . It has to be dynamic.
For instance , in the code logic above
you can see offsets -10 and -9 in Prev N . this has to be dynamic.
in the period min , you can see 10. This can be any number which is greater than 3.
if we denote this number by x then the offset in prev N will become -x and (1-x).
Currently, you cannot create a condition that would check this without an Offset in Streak. A known distance needs to be mentioned so that system can compare the values. Without a mentioned distance this becomes subjective