How to write the minimum of Stochastic

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #54918 quote
    Gianluca
    Participant
    Master

    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[7](close)C2 = RSI[7](Dclose(2))d1 = c2 < 30d2= c1 > 35IF C1 CROSSES OVER 30 and d1 and d2 and not daysForbiddenEntry thenBUY PositionSize CONTRACT AT MARKETENDIF  

    ////PARAMETRI
    C1 = RSI[7](close)
    C2 = RSI[7](Dclose(2))
    d1 = c2 < 30
    d2 = c1 > 35
    IF C1 CROSSES OVER 30 and d1 and d2 and not daysForbiddenEntry then
       BUY PositionSize CONTRACT AT MARKET
    ENDIF  

     

    stoc-esempio.jpg stoc-esempio.jpg
    #54935 quote
    robertogozzi
    Moderator
    Master

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

    Roberto

    Nicolas and Gianluca thanked this post
    #54955 quote
    Gianluca
    Participant
    Master

    Sorry 🙂

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

How to write the minimum of Stochastic


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Gianluca @altares Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Gianluca
8 years, 3 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/06/2017
Status: Active
Attachments: 1 files
Logo Logo
Loading...