Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MA doesn't like my indicator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    MA doesn't like my indicator

    Hi all!

    Here's my scenario:
    I have 4 custom indicators that work just fine on the charts, however, when I add them to MA all I get back is the last price of the stock. I'm not certain if I'm adding them wrong to the MA or if my indicators need to be tweaked to work within MA? the indicators are an EMA 8 crossover and their follow up confirmations. I've copied the code for one of them below.

    Thanks in advance!

    Brandon~

    if (CurrentBar < 1) return;

    // Crossover Up Indicator
    if(Close[1] <= EMA(8)[1] && Close[0] > EMA(8)[0])
    {
    DrawTriangleUp(CurrentBar.ToString(), true, 0, (1.02 * (High[0] + TickSize)), Color.LimeGreen);
    }

    #2
    Hello lilzenbca,

    Thanks for your post.

    The Market analyzer will only show dataseries.

    If i understand correctly, in the example, you want the market analyzer to show an indication when the condition if(Close[1] <= EMA(8)[1] && Close[0] > EMA(8)[0]) occurs.

    What you will need to do is create a dataseries and expose that so that the market analyzer will be able to use it in the "plot" selection of the market analyzer.

    There are 4 steps to code the process. For the example I will name the dataseries xup.

    In the region variables:
    private DataSeries xup ; // will hold the +1 signal for cross

    in the initialize section:

    xup = new DataSeries (this) ;

    In the onbarUpdate section:
    if(Close[1] <= EMA(8)[1] && Close[0] > EMA(8)[0])
    {
    DrawTriangleUp(CurrentBar.ToString(), true, 0, (1.02 * (High[0] + TickSize)), Color.LimeGreen);
    xup.Set(+1); // Set the signal for a cross
    }
    else xup.Set(0); // otherwise 0 = no signal

    In the region Properties:

    [Browsable (false)]
    public DataSeries Xup // note capital
    {
    get { return xup;} // note lower case and ;
    }

    Once you have successfully compiled then you can add the indicator to the Market Analyzer. You will find that you can select the dataseries "Xup" in the plot section. So at this point all that will show is 1 or 0. You can then set the market analyzers cell conditions to provide a color and or text display based on the cell = 1.

    Please let me know if I can be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    72 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    44 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    26 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    31 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    61 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X