Reply

Looking for a “Streak” indicator

1 replies

tmantrader

Subscriber, bbp_participant, customer, community, sq-ultimate, 5 replies.

Visit profile

2 years ago #276237

Looking for a simple indicator: Return to me the number of bars in a row that Close[x] < Close[x+1] or Close[x] > [x+1] –> the current “Streak” It will either be negative (if price is going down) or positive (if price is going up), or zero if neither (equal).

So if i’ve gone down three bars in a row, Streak = -3, if I’ve gone up three bars in a row Streak = +5. If I stayed the same Streak = 0.

My intent would then be to use the value returned and compare it to a randomvalue in an SQX strategy.

if streak < -randomvalue (ranging it from 1:10:1), then enter the position, etc.

I’m not a programmer, and the indicators don’t seem all that easy to create given what I see in the library. It took me 5 minutes in TradeStation EZ language.

You may have this already, but I can’t find anything like it.

Thanks.

Tom C

Tom C

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

2 years ago #276273

Hello,

it can be done using a built-in function – comparison to last X bars. Check the example attached

Attachments:
You must be logged in to view attached files.

1

Viewing 1 replies (of 1 total)