STD Last Low and last High
Forums › ProRealTime English forum › ProOrder support › STD Last Low and last High
- This topic has 10 replies, 3 voices, and was last updated 2 years ago by Khaled.
-
-
01/07/2022 at 1:39 AM #184791
Hello,
I’d like to call in my system the BARINDEX[n] of the LAST Low and the last High of STD[20] (not the highest[p] or Lowest[p]), because if I use highest[p], it is possible that the result is the second to last (if it’s higher than the last one). So the question is if I’m at the last candle what’s the number [n] of the last high of STD.
I tried Array with no success certainly due to my limited skills. It should look like this:
1234567891011iSTD = STD[20]// find "n" which corresponds to the number the of the last High / Low of iSTDcond1 = iSTD[1]>iSTD and iSTD[1]>iSTD[2]cond2 = iSTD[1]<iSTD and iSTD[1]<iSTD[2]//find "n"return nThanks a million.
01/07/2022 at 9:40 AM #184800If you don’t use any period, any bar can be either the new LOW or the new HIGH.
You always have to set an interval/range, usually it’s periods, or the whole data history.
Try this one:
123456If iSTD < iSTD[1] thenLowBAR = barindexEndifIf iSTD > iSTD[1] thenHighBAR = barindexEndifLowBAR and HighBAR are the barindex numbers you are looking for.
01/07/2022 at 10:43 AM #18481001/07/2022 at 11:02 AM #184813Hi Khaled and robertogozzi.
How would u use this in a strategy.
I trying to make a simple and hopefully as robust strategy as possible.
A mtf strategy with 1 indicator with inspiration from Jebus89
timeframe daily: rsi 2 > 95
timeframe 4 hours: rsi 2 > 95
timeframe 1 hour: rsi crosses under 95
Sell at daily timeframe when rsi 2 crosses under 30
https://www.prorealcode.com/topic/multitimeframe-simple-conditions/page/2/
Someting like this but maybey with std highbar lowbar. What do u think?
01/07/2022 at 12:19 PM #184821Hi SnorreDK
Thanks for your feedback and the suggestion to use RSI[2] crossing on higher TF.
What I observed on the attached graph, is that if you go Long or Short according to your entry point and want to optimize Exit point (not too early, not too late), then you should Exit at the next turning point of the STD. Obviously I tried the following but it didn’t give optimum result.
1234567if shortonmarket and (close>close[1] and high>high[1] and low>low[1]) thenexitshort at marketendifif longonmarket and (close<close[1] and high<high[1] and low<low[1]) thensell at marketendifAny clue how to code this LAST STD[20] turning point?
01/07/2022 at 12:34 PM #184823You simply have to check when STD[20] is greater or lower than the prior bar.
1 user thanked author for this post.
01/07/2022 at 12:39 PM #184825Thanks robertogozzi, you always save me time. Often times, the simplest solutions are the best.
01/07/2022 at 1:00 PM #18482701/08/2022 at 2:09 PM #184886So just to update you… I tested exit option (1) cross over/under RSI[n] as suggested above vs. (2) STD reversal and the RSI outperforms by far, despite the STD looks very on the graph :). This is obviously based on my system, it doesn’t mean it’s true across the board.
01/08/2022 at 2:17 PM #18488701/08/2022 at 2:26 PM #184889 -
AuthorPosts
Find exclusive trading pro-tools on