Moving Average Strategy

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13913 quote
    murugs2601
    Participant
    New

    Hi ALL,

    Can some one please support me in writting the codes for Variable Definition for below ?

    ++++++++++
    // Definition of Code Parameters
    DEFPARAM CumulateOrders = False
    
    //Cumulating Positions Deactivated
    
    DEFPARAM FLATAFTER = 215500
    
    
    
    Below variables are easy to define in PROBacktest Variable Definition Menu,
    
    But PROAutotrade system insists that these variables to be defined inside programming.
    
    // ADD Variable definition
    
    Label in program “Short”
    
    Label in properties window “ShortMA”
    
    Restriction > 0
    
    Minimal Value 10 
    
    Maximum Value 50
    
    Step (Interval) 5
    
     
    
    // ADD Variable definition
    
    Label in program “Long”
    
    Label in properties window “LongMA”
    
    Restriction > 0
    
    Minimal Value 30
    
    Maximum Value 60
    
    Step (Interval) 5
    
    
    
    MAShort = Average[Short] (Close)
    
    MALong = Average[Long] (Close)
    
    
    
    // Conditions to Enter Long Positions
    
    C1 = (MAShort CROSSES OVER MALong)
    
    
    
    IF C1 THEN
    
    BUY 1 CONTRACT AT MARKET
    
    ENDIF
    
    
    
    //Conditions to Exit Long Positions
    
    C2 = (MAShort CROSSES UNDER MALong)
    
    
    
    IF C2 THEN
    
    SELL AT MARKET
    
    ENDIF
    
    
    
    //Conditions to Enter Short Positions
    
    C3 = (MAShort CROSSES UNDER MALong)
    
    
    
    IF C3 THEN
    
    SELLSHORT 1 CONTRACT AT MARKET
    
    ENDIF
    
    
    
    //Conditions to Exit Short Positions
    
    C4 = (MAShort CROSSES OVER MALong)
    
    
    
    IF C4 THEN
    
    EXITSHORT AT MARKET
    
    ENDIF
    
    
    
    //Stops and Targets
    
    SET STOP pTRAILING 25
    
    ++++++++++++++++++++++++++++++++++++++++++++++++++
    #13915 quote
    Nicolas
    Keymaster
    Master

    Of course, because you need to define the indicators periods’ “Short” and “Long”

    In this strategy description, the author mean that you can optimize yourself the periods with the PRT backtest optimizer.

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

Moving Average Strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
murugs2601 @murugs2601 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
9 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/29/2016
Status: Active
Attachments: No files
Logo Logo
Loading...