• 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 Dot into indicator window

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

    Plot Dot into indicator window

    hi,
    i'd like to plot a dot into the indicator window.

    for example: if close [0] > open [0] -> plot a dot on position +1 [0]

    compared to the tutorial:
    Plot0.Set (Close [0] > Open [0] ? 1:0)
    i receive the result either on 1 or on 0

    so, what can i do to receive the dot for the given condition only on position +1 [0]?

    thx for your assistance!!

    #2
    Hello Tradexxx,
    Thanks for posting today.

    Plot0.Set (Close [0] > Open [0] ? 1:0)
    i receive the result either on 1 or on 0
    This statement is functioning as written. The condition Close [0] > Open[0] will return a true or false result which will then return a 1 on when true and a 0 when false. Then this will set the Plot0 to 1 or 0.

    I am a little confused on what you are trying to accomplish with

    position +1 [0]

    Are you referencing a position in a strategy? (long or short)
    A position in the plot? (Next bar?)
    Are you are referring to the current Price?

    If you could provide a little more information I can better assist you.
    Alex G.NinjaTrader Customer Service

    Comment


      #3
      Hi AlexG,
      thx for the response!


      Are you referencing a position in a strategy? (long or short)
      no, not in the first step. (but therefore i thought i have to use the plot mechanism to be able to use the indicator later in another indicator - hopefully i'm not wrong?)

      i'll try to explain:
      - i'd like to plot a dot in the indicator window
      - the dot can have the figures "+1" or "0" or "-1", depending on the result of the if-condition
      - hopefully working like a small oscialltor
      - if the condition is fullfilled on bar [0], the dot has to be on position [0] - displaying "+1" or "0" or "-1"
      - back to the example from the beginning: if Close[0] > Open[0] -> plot a dot on y-axis = "+1" and x-axis [0] in the indicator window
      - using the described formula from the tutorial i'll reveive something like either "+1" or "0", but i can't met my other conditions, or?
      if there's any other easier solution, i'll be happy to use.
      thx !
      Last edited by Tradexxx; 04-07-2015, 11:14 AM.

      Comment


        #4
        Hello,
        Thanks for the clarification.

        From what you describe it seems you need three different return conditions, +1, 0, -1.

        An if statement can only have two return conditions(true or false). To accomplish the third condition it would depend on what you want to trigger the third response.

        Here is an example of code that would check if a close[0] is above, equal, or below a variable num.

        Code:
        if (Close[0] > num)
        {
        return 1;
        } else if (Close[0] <1) {
        return -1;
        } else {
        return 0;
        }
        To add text to your dot you can use the DrawText() method using the same barsAgo parameter settings as you did with your DrawDot().

        Here is a link to the help guide documentation on the DrawText() and DrawDot() method.
        http://www.ninjatrader.com/support/h...l?drawtext.htm
        http://www.ninjatrader.com/support/h...ml?drawdot.htm

        Please let us know if we may be of further assistance for anything NinjaTrader.
        Alex G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jtrading82, Today, 01:55 PM
        4 responses
        27 views
        0 likes
        Last Post bppayne
        by bppayne
         
        Started by Hagar, Today, 06:52 PM
        0 responses
        1 view
        0 likes
        Last Post Hagar
        by Hagar
         
        Started by vivekniwas, Today, 04:56 PM
        0 responses
        6 views
        0 likes
        Last Post vivekniwas  
        Started by dtl-saw, Today, 03:36 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by williamzz, Today, 02:04 PM
        2 responses
        13 views
        0 likes
        Last Post williamzz  
        Working...
        X