Double Rsi strategy

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #141150 quote
    Gaby333
    Participant
    Junior

    I want to share this code with you as i think that can be improved.Please fell welcome to comment and come with more idea .

    // Main code : Rsi
    //-------------------------------------------------------------------------
    DEFPARAM CumulateOrders = true//
    
    indicator1=RSI[14](close)
    indicator2=RSI[2](close)
    //condition to enter long
    c1=(indicator2 crosses over indicator1)
    c2=(RSI[14](close) > 50)//RSI upward momentum
    c3=(RSI[2](close) <70)//RSI downword momentum
    c4=(indicator2 crosses under indicator1)
    if c1 and c2 then
    buy 1 contracts at market
    endif
    Set target pprofit c3
    SET STOP pLOSS c4
    //Conditions to enter short
    c1=(indicator2 crosses under indicator1)
    c2=(RSI[14](close) < 50)//RSI downword momentum
    c3=(RSI[2](close) >30)//RSI upword momentum
    c4=(indicator2 crosses over indicator1)
    if c1 and c2 then
    buy 1 contracts at market
    endif
    Set target pprofit c3
    SET STOP pLOSS c4
    ukxhourh-1596878075p4cl8.png ukxhourh-1596878075p4cl8.png
    #141296 quote
    GraHal
    Participant
    Master

    C3 and C4 will give True / 1 and so can’t be used for Stop values as pProfit and pLoss need to be a value / number of points of price change?

    I take it Line 23 is a typo and should be SellShort (not Buy)?

    #141302 quote
    robertogozzi
    Moderator
    Master

    Nice (double) spot GraHal!

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

Double Rsi strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Gaby333 @gaby333 Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by robertogozzi
5 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/10/2020
Status: Active
Attachments: No files
Logo Logo
Loading...