Smoothed stochastic trading strategy

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7643 quote
    Robert975
    Participant
    Junior

    Hi Guys, Here’s a code based on the Smoothed Stochastic. I think it needs a bit more improving on the code. But, for the first time i get it to test it from 1991 till 20 May 2016 Not many profit over these years, so If someone can use it and make it better. Here is the code

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
     
    // Conditions to enter long positions
    indicator1 = SmoothedStochastic[20,3](typicalPrice)
    indicator2 = ExponentialAverage[5](SmoothedStochastic[20,3](typicalPrice))
    c1 = (indicator1 CROSSES OVER indicator2)
     
    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
     
    // Conditions to exit long positions
    indicator3 = SmoothedStochastic[20,3](typicalPrice)
    indicator4 = ExponentialAverage[5](SmoothedStochastic[20,3](typicalPrice))
    c2 = (indicator3 CROSSES UNDER indicator4)
     
    IF c2 THEN
    SELL  AT MARKET
    ENDIF
     
    // Conditions to enter short positions
    indicator5 = SmoothedStochastic[20,3](typicalPrice)
    indicator6 = ExponentialAverage[5](SmoothedStochastic[20,3](typicalPrice))
    c3 = (indicator5 CROSSES UNDER indicator6)
     
    IF c3 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
     
    // Conditions to exit short positions
    indicator7 = SmoothedStochastic[20,3](typicalPrice)
    indicator8 = ExponentialAverage[5](SmoothedStochastic[20,3](typicalPrice))
    c4 = (indicator7 CROSSES OVER indicator8)
     
    IF c4 THEN
    EXITSHORT  AT MARKET
    ENDIF
     
    // Stops and targets
    SET STOP pLOSS 15
    SET TARGET pPROFIT 15
    germany-cash-eur-mini-dax-smoothed-stochastic-1463837149cp48l1.png germany-cash-eur-mini-dax-smoothed-stochastic-1463837149cp48l1.png
    #7647 quote
    Nicolas
    Keymaster
    Master

    Hello Robert, thanks for your time and effort. This is the second time you use the library form post instead of the forums one. I plan to make it more clear for everyone to see where to post, but in the meantime, please use forums for this type of request 🙂 Thanks in advance!

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

Smoothed stochastic trading strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Robert975 @robert975 Participant
Summary

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

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