Step MA Indicator not Recognised by Strategy

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #125670 quote
    Yantra
    Participant
    Senior

    PRC_step one more average | indicator

    I love this indicator! It would be great to incorporate it in an automatic trading strategy. However, being a novice to coding I use the “Simplified creation” option and I can find no way to have this indicator’s “steps” over the price recognized in the strategy. Is there a way to overcome this so that the steps are noted in the strategy? Any help appreciated and a HUGE thank you to Nicolas for all that you have created and shared here!!

    #125674 quote
    Vonasi
    Moderator
    Master

    The only way to include the indicator in a strategy is via hard coding it in.

    This is not that difficult though. Just copy the indicator code into your strategy beneath any defparam instructions and then remove the RETURN line. You may want to then remove the // before the variable settings at the start of the code or add them as optimised variables. You will also need to delete the lines that refer to color. You should then have a value in your strategy called ‘Result’ which is the value of the average so you can check the following;

    if close > result then
    
    if close < result then
    Yantra thanked this post
    #125683 quote
    Vonasi
    Moderator
    Master

    Actually there is another way  you can CALL the indicator.

    CALL

    Add the following to your strategy and then your strategy will have ‘Result’ as the step average value (not tested):

    Length       = 25
    Speed        = 3.0
    Adaptive     = true
    Sensitivity  = 0.5     // Sensivity Factor
    StepSize     = 50      // Step Size period
    
    result = CALL "prc_step-one-more-average"[length,speed,adaptive,sensitivity,stepsize]
    Yantra thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Step MA Indicator not Recognised by Strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Yantra @rover220 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Vonasi
5 years, 10 months ago.

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