help needed to improve moving average trading strategy

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23954 quote
    chaostrader82
    Participant
    New

    hi all, i need some help to improvise this strategy. The following moving average needs improvements as there are positions being opened in a fluctuating market resulting in heavy loss as shown in the picture attached. Can someone help to modify it ?

    Required improvements
    1. BUY only if current price is more than previous close

    Problems
    1. Positions opened in fluctuating markets
    2. Position open on par with open rate resulting in ZERO / Loss senarios
    3. Strategy only useful in a trending upwards market
    =========================================================================

     

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = TRUE // Cumul des positions activé
    indicator1 = close
    indicator2 = Average[5](close)
    c1 = (indicator1 CROSSES OVER indicator2)
    IF c1 THEN
    BUY 5 CONTRACT AT MARKET
    ENDIF
    
    // Conditions pour fermer une position acheteuse
    indicator3 = close
    indicator4 = Average[14](close)
    c2 = (indicator3 CROSSES OVER indicator4)
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    losing-positions.jpg losing-positions.jpg
    #23959 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    For clarity of messages on ProRealCode’s forums, please use the “insert PRT code” button to separate the text of the code part! Thank you! <<

    (PRT code has been edited above, and this is how it should look like when using the “insert PRT code” button)

    #24076 quote
    Nicolas
    Keymaster
    Master

    About your first request, you could replace your c1 condition with this one instead:

    c1 = (indicator1 CROSSES OVER indicator2) and close>close[1]

    Concerning the “problems” you mentioned, this is indeed what you have to face with a  strategy build upon criteria of trend following.

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

help needed to improve moving average trading strategy


General Trading: Market Analysis & Manual Trading

New Reply
Author
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by Nicolas
9 years ago.

Topic Details
Forum: General Trading: Market Analysis & Manual Trading
Language: English
Started: 02/05/2017
Status: Active
Attachments: No files
Logo Logo
Loading...