Possible bug or is it bad code?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #92419 quote
    jebus89jebus89
    Participant
    Master
    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Conditions to enter long positions
    divergencePRICE = (close < lowest[6](close[1]))
    divergenceRSI = (RSI[2](RSI[4](close)) > lowest[6](RSI[2](RSI[4](close))[1]))
    
    div = divergenceRSI and divergenceprice
    
    downFAST = (RSI[2](RSI[4](close)) CROSSES UNDER Average[10](RSI[4](close)))
    downMID = (RSI[4](close) CROSSES UNDER Average[10](RSI[4](close)))
    downSLOW = (RSI[6](RSI[4](close)) CROSSES UNDER Average[10](RSI[4](close)))
    
    down = downfast and downmid and downslow
    div = divergenceRSI and divergenceprice
    buytime = div and down
    
    IF buytime THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator9 = Average[20](close)
    c6 = (close CROSSES UNDER indicator9)
    
    IF c6 THEN
    SELL AT MARKET
    ENDIF
    

     

    Buggy code or my bad?
    Wall st 1h.

     

    edit: first yellow arrow is pointing to the wrong rsi dip but same goes for the actual dip. Its below the lowest low of last 6 rsi and my condition is that the current RSI is ABOVE the last 6 rsi lowest lows. Not sure if its buggy stuff or just me thats thinking wrong somehow.

     

    edit2: this is a shit code, im just playing around.

    bug.png bug.png
    #92449 quote
    NicolasNicolas
    Keymaster
    Legend

    Did you “graph” variables to compare with the indicator?

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Possible bug or is it bad code?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
jebus89 @jebus89 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
7 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/26/2019
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...