Forex, 1 minute, Simple RSI.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #72106 quote
    alex.bantleman
    Participant
    New

    EUR:USD 1 min = 51.79
    USD:CHF 1 min = 41.86
    GBP:USD 1 min = 41.43
    AUD:USD 1 min = 33.36
    EUR:GBP 1 min = 30.36
    GBP:EUR 1 min = 23.86

    The number is the average point gain per week and the equity curves look steady so there’s no huge anomalies.

    Very simple code but looks effective.

    Can someone also help me with applying an automatic increase / decrease in position size, relative to the strategy profit? I’m thinking for every +- £100 to increase / decrease position size by 0.1.

    The code is below. Please feel free to edit with your thoughts and to let me know about the position size!

    Thanks!!

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Conditions to enter long positions
    indicator1 = RSI[14](close)
    c1 = (indicator1 < 20)
    
    IF c1 AND not daysForbiddenEntry THEN
    BUY 1 PERPOINT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator2 = RSI[14](close)
    c2 = (indicator2 > 60)
    
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    indicator3 = RSI[14](close)
    c3 = (indicator3 > 75)
    
    IF c3 AND not daysForbiddenEntry THEN
    SELLSHORT 1 PERPOINT AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    indicator4 = RSI[14](close)
    c4 = (indicator4 < 40)
    
    IF c4 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    Own-RSI.itf detailed-report-eurusd-1528023193l4pc8.jpg detailed-report-eurusd-1528023193l4pc8.jpg
    #72218 quote
    JR1976
    Participant
    Veteran

    HI ALex

    congrats for the code …

    play whit this “routine ”  find in the Forum ..

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    //
    Reinvest=1
    if reinvest then
    //Capital = 10000
    Capital = 1000
    //Risk = 1//in % pr position
    Risk = 10//0.1//in % pr position
    StopLoss = 50
    //StopLoss = 70
    REM Calculate contracts
    equity = Capital + StrategyProfit
    maxrisk = round(equity*(Risk/100))
    MAXpositionsize=1000
    //MINpositionsize=1
    MINpositionsize=1
    Positionsize= MAX(MINpositionsize,MIN(MAXpositionsize,abs(round((maxrisk/StopLoss)))))//*Pointsize))))
    else
    Positionsize=1
    StopLoss = 50
    //StopLoss = 70
    Endif
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    // Conditions to enter long positions
    indicator1 = RSI[14](close)
    c1 = (indicator1 < 20)
    
    IF c1 AND not daysForbiddenEntry THEN
    BUY   Positionsize  perpoint  AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator2 = RSI[14](close)
    c2 = (indicator2 > 60)
    
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    indicator3 = RSI[14](close)
    c3 = (indicator3 > 75)
    
    IF c3 AND not daysForbiddenEntry THEN
    SELLSHORT  Positionsize PERPOINT AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    indicator4 = RSI[14](close)
    c4 = (indicator4 < 40)
    
    IF c4 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    Prorealcode.png Prorealcode.png
    #72256 quote
    JR1976
    Participant
    Veteran

    In my picture i mistake the spread  , that for EUR/USD  is  competitive and the different are not too big

    But if you test the other cross

    EUR:USD 1 min = 51.79
    USD:CHF 1 min = 41.86
    GBP:USD 1 min = 41.43
    AUD:USD 1 min = 33.36
    EUR:GBP 1 min = 30.36
    GBP:EUR 1 min = 23.86

    I think you didn’tconsider the spread in your test , is it correct ?

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

Forex, 1 minute, Simple RSI.


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by JR1976
7 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/04/2018
Status: Active
Attachments: 3 files
Logo Logo
Loading...