STD Last Low and last High

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #184791 quote
    Khaled
    Participant
    Veteran

    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:

    iSTD = STD[20]
    
    // find "n" which corresponds to the number the of the last High / Low of iSTD
    
    cond1 = iSTD[1]>iSTD and iSTD[1]>iSTD[2]
    
    cond2 = iSTD[1]<iSTD and iSTD[1]<iSTD[2]
    
    //find "n"
    
    return n

    Thanks a million.

    Capture-décran-2022-01-07-à-01.19.24.png Capture-décran-2022-01-07-à-01.19.24.png
    #184800 quote
    robertogozzi
    Moderator
    Master

    If 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:

    If iSTD < iSTD[1] then
       LowBAR = barindex
    Endif
    If iSTD > iSTD[1] then
       HighBAR = barindex
    Endif

    LowBAR and HighBAR are the barindex numbers you are looking for.

    #184810 quote
    Khaled
    Participant
    Veteran

    Many thanks Roberto!

    #184813 quote
    SnorreDK
    Participant
    Junior

    Hi 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

    MultiTimeFrame simple conditions

    Someting like this but maybey with std highbar lowbar.  What do u think?

    #184821 quote
    Khaled
    Participant
    Veteran

    Hi 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.

    if shortonmarket and (close>close[1] and high>high[1] and low>low[1]) then
    exitshort at market
    endif
    
    if longonmarket and (close<close[1] and high<high[1] and low<low[1]) then
    sell at market
    endif

     

    Any clue how to code this LAST STD[20] turning point?

    Capture-décran-2022-01-07-à-12.07.48.png Capture-décran-2022-01-07-à-12.07.48.png
    #184823 quote
    robertogozzi
    Moderator
    Master

    You simply have to check when STD[20]  is greater or lower than the prior bar.

    Khaled thanked this post
    #184825 quote
    Khaled
    Participant
    Veteran

    Thanks robertogozzi, you always save me time. Often times, the simplest solutions are the best.

    #184827 quote
    SnorreDK
    Participant
    Junior

    If u come up with something it would be intresting to see khaled

    #184886 quote
    Khaled
    Participant
    Veteran

    So 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.

    #184887 quote
    SnorreDK
    Participant
    Junior

    Intresting.

    Thanks for ur feedback khaled.

    What entryposition do u use

    #184889 quote
    Khaled
    Participant
    Veteran

    You mean my system? it’s based on a combination of Stochastics, MACD, MAs with a few filter. Still under development.

    SnorreDK thanked this post
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

STD Last Low and last High


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Khaled @khaled Participant
Summary

This topic contains 10 replies,
has 3 voices, and was last updated by Khaled
4 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/07/2022
Status: Active
Attachments: 2 files
Logo Logo
Loading...