• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

plot an oscillator on a signal

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

    plot an oscillator on a signal

    I have an indicator that plots buy/sell signals How can i plot oscillator on a signals over time? the values of the oscillator can simply be 1 for buys and -1 for sells ... so basically an indicator on an indiocator....the code looks something like this
    Code:
    				Alert("Volume Alert", NinjaTrader.Cbi.Priority.High,Instrument.FullName+": Volume above threshold", "Alert1.wav", 10, Color.White, Color.Yellow);
    						if (Open[0]<=Close[0])
    							DrawArrowDown("tag_"+CurrentBar.ToString(), true, 0, High[0]+1*TickSize, Color.Red);

    #2
    Hello,

    Thank you for the question.

    I wanted to clarify this question, I will explain how I have understood the question, can you provide details to let me know if my thinking is correct?

    I understand this as you have an indicator that is drawing arrows when your condition is true. You are trying to plot a line based on this indicators arrows or the more specifically the condition that causes the arrow. Is this correct?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      that is correct

      that is correct ... i want to plot a simple binary line/dot/bar when my conditions are met. in this case when a buy is triggered plot 1 when a sell is triggered plot -1

      Comment


        #4
        Hello,

        For a 1 or 0 a bar generally is the easiest to see, for this the best example would be the VOL indicator that comes with NinjaTrader.

        Looking at the code you will see 2 sections of code that contribute to plotting a value.

        Code:
        protected override void Initialize()
        {
        	Add(new Plot(new Pen(Color.Blue, 2), PlotStyle.Bar, "Volume"));
        	Add(new Line(Color.DarkGray, 0, "Zero line"));
        }
        This creates a Plot that can be used.


        Code:
        protected override void OnBarUpdate()
        {
        	Value.Set(Volume[0]);
        }
        Value would be the default name for the first or single plot in an indicator, please see the following link for more information;
        http://ninjatrader.com/support/helpG...ightsub=Values

        You could simply set the value when the condition becomes true to 1 and that would make a 1 value bar plotted.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rouillard, Today, 03:34 PM
        2 responses
        22 views
        0 likes
        Last Post rouillard  
        Started by mquinteroj, Today, 02:41 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by JPPoulin, Today, 01:32 PM
        4 responses
        15 views
        0 likes
        Last Post JPPoulin  
        Started by bltdavid, Today, 01:09 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by pstrusi, Today, 12:50 PM
        2 responses
        8 views
        0 likes
        Last Post pstrusi
        by pstrusi
         
        Working...
        X