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 Touch-Ups, 04-27-2024, 10:36 AM
            3 responses
            30 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by D Trader, 05-02-2017, 09:12 AM
            21 responses
            4,289 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by leojimenezp, 04-20-2024, 05:49 PM
            3 responses
            38 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by algospoke, 04-28-2024, 06:41 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by cmtjoancolmenero, 04-25-2024, 03:58 PM
            14 responses
            60 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X