Hi everybody, i would to implement inside a trading sistem a code that can find the bottom of an oscillator like RSI or the Stock, but i don’t know how. As you can see in the photo some times when the indicator cross the like could be too late to start a trade, so i would find a solution someone can help me? i tried to write something like this, but is very rudimental: ////PARAMETRIC1 = RSI(close)C2 = RSI(Dclose(2))d1 = c2 < 30d2= c1 > 35IF C1 CROSSES OVER 30 and d1 and d2 and not daysForbiddenEntry thenBUY PositionSize CONTRACT AT MARKETENDIF
I moved your post to the English forum. You cannot use a language different from that of the forum you choose.
I also modified the last word of your title Stoc in Stochastic, to make it clearer.
As for your question about highest and lowest values of the Stochastic or Rsi, you can only determine it hit a new minimun/maximum AFTER it’s passed, because whenever it sets a new maximum/minimun how can you foretell the next bar it will not go any higher/lower?
So, to determine the maximun/minimum of an oscillator you have to select the number of past bars you want to scan (10, 20, 30….?) and use HIGHEST/LOWEST to retrieve it. An alternative way is to use FOR…NEXT loops, but you won’t get better results and will slow down execution.
If you need to search documentation and tons of examples about any keyword or topic, you may want to use the search box that opens whenever your mouse hovers your avatar (upper right corner, in the blue menu bar).
Warning: Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced clients who have sufficient financial means to bear such risk. The articles, codes and content on this website only contain general information. They are not personal or investment advice nor a solicitation to buy or sell any financial instrument. Each investor must make their own judgement about the appropriateness of trading a financial instrument to their own financial, fiscal and legal situation.