Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

ATM Strategy and drawing objects

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

    ATM Strategy and drawing objects

    Hello

    I have an ATM strategy that works fine. I want to use any drawing tool to point the signal bar but I can't. Only Barbrush and CandleOutlineBrush work.

    BarBrush = Brushes.Fuchsia;
    CandleOutlineBrush = Brushes.Fuchsia;
    Draw.Text(this, "Great"+CurrentBar, false, @"O", 0, High[0] + 8 * TickSize , 0, Brushes.Fuchsia, largeFont, TextAlignment.Center, Brushes.Transparent, Brushes.Transparent, 0);

    As you can see in image attached, text is drawn but in a fix level. How can I fix that?

    Thanks

    Attached Files

    #2
    Hello Impeesa,

    The Text is set to be drawn 8 ticks above the high of the most recent bar.

    Where you do want the text drawn instead?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      The text is drawn 8 ticks above Open RTH... I would like to draw 8 ticks above the bar where conditions are met, as BarBrush does

      Comment


        #4
        Hello Impeesa,

        The code you have written for the price is:

        High[0] + 8 * TickSize

        That's the High of the most recently updated bar plus 8 ticks.

        At what price were the conditions met? Add 8 ticks to that price.
        Code:
        myDoubleConditionPrice = 1000;
        
        if (Close > myDoubleConditionPrice)
        {
        Draw.Text(this, "Great"+CurrentBar, false, @"O", 0, myDoubleConditionPrice + 8 * TickSize , 0, Brushes.Fuchsia, largeFont, TextAlignment.Center, Brushes.Transparent, Brushes.Transparent, 0);
        }
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          As you can see, the price that is taken as reference is Opening Price and I can not understand why...
          Attached Files

          Comment


            #6
            Hello Impeesa,

            A drawing object will be drawn at the price supplied to it.

            Print the time and the high one line above the Draw method call.

            Below is a link to a forum post that demonstrates using prints to understand behavior.
            https://ninjatrader.com/support/foru...121#post791121

            I'm suspicious this script has multipile series, so I am including the BarsInProgress as well.

            Print(string.Format("{0} | BarsInProgress: {1}, High[0]: {2}", Time[0], BarsInProgress, High[0]));

            Please include the output from the print with your next post.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ssijbabu, 10-07-2012, 07:10 AM
            6 responses
            4,430 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by iceman2018, Today, 10:39 AM
            1 response
            2 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by nleitman, Yesterday, 11:46 AM
            16 responses
            44 views
            0 likes
            Last Post nleitman  
            Started by MSerag, Yesterday, 11:52 PM
            3 responses
            23 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by dcriador, Yesterday, 01:43 AM
            6 responses
            29 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X