## Indexing and Stream values

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

### Indexing and Stream values

I am in the process of creating various types of indicators. Right now I am having difficulties understanding why some values are not evaluating as they should in Lua. Attatched is a simple code that has a loop looking for the lowest low over X periods.

This value is then assigned to a stream. Which I name intI[period]. Below I am trying to simply evaluate if the value in the stream is > or < certain values. The test that is saved is if the value == 5 then intIV[period] = intI[period].

My thought is that if the value in intI[period] is 5 than I should filter out all other stream values from intI[period]. When you run this script you will see it's not true though. It outputs values for 6 and 5. I can't wrap my head around why this is the case. There has to be something fundamental that I am missing about the language.

3am.gjp

Posts: 4
Joined: Tue Jun 26, 2018 11:31 am

### Re: Indexing and Stream values

If your goal is to find the minimum, you can use mathex.min.
min, minpos = mathex.min (source, period-10 +1, period)
This will find a minimum for last 10 candles.

Apprentice
FXCodeBase: Confirmed User

Posts: 30358
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Indexing and Stream values

My advice is to install the SDK.
http://fxcodebase.com/documentation.php
Contains Editor, Debugger, Extensive Help with examples.

If you'd be interested, I hold private sessions.
Prerequisite intermediate coding knowledge.

Apprentice
FXCodeBase: Confirmed User

Posts: 30358
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Indexing and Stream values

Thanks, I've installed it, and it does help a lot! I'm starting to brain out how all of that works, but I'm lacking experience and technical knowledge, and the SDK is a gold mine for that.
Strela_999

Posts: 7
Joined: Thu Jan 30, 2020 12:29 pm