Topic: Moving Average - Different Long/Short Criterea

Hi all,

Can anyone tell me if it's possible in FSB to create the following open logic condition somehow:

Long - Open Above High MA
Short - Open Below Low MA

I can get it to apply a single MA criteria e.g. (long-above or short-below one MA condition) but can't seem to work out a way to specify a different (high/low) MA depending on where it's looking at opening a long or short trade (without creating two separate strategies for long and short).

Can anyone provide further insight or a solution?

Thanks,
Tania

Re: Moving Average - Different Long/Short Criterea

Hey,

I know there was an indicator for your strategy, but I can't find it... I need a little bit of time for search.

3 (edited by footon 2020-11-10 10:31:21)

Re: Moving Average - Different Long/Short Criterea

This should work.

Post's attachments

HighLowBands.cs 24.17 kb, 7 downloads since 2020-11-10 

You don't have the permssions to download the attachments of this post.

Re: Moving Average - Different Long/Short Criterea

Good job Footon!

Thank you!



https://image-holder.forexsb.com/store/high-low-ma-bands.png


You can fix the ToString function to not show the unused ListParam[2]

public override string ToString()
{
    return string.Format("{0}{1} ({2}, {3}, {4})",
                         IndicatorName,
                         (IndParam.CheckParam[0].Checked ? "*" : ""),
                         IndParam.ListParam[1].Text,
                         IndParam.NumParam[0].ValueToString,
                         IndParam.NumParam[1].ValueToString);
}

Re: Moving Average - Different Long/Short Criterea

Yeah, I know smile I find the SetDescription and the ToString function most annoying actually, a bit of a time waste with no real gain, but that is my internal wiring. Fixed version uploaded.

Re: Moving Average - Different Long/Short Criterea

Yea, I know. Someday I'll start a new project with better custom indicators, trading rules, criteria...