Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart Trader Graphics for Strategies.

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

    Chart Trader Graphics for Strategies.

    When I write strategies, I like to include lines to indicate the positions of orders, executions etc. Although I try hard, I cannot do this with the efficiency and beauty of the chart trader.
    I know that I can see the chart trader displaying my strategy trades on a seperate chart, but it would be nice not to need two charts. Since the graphics of the chart trader are obviously already in existence, why not just make them avaiolable in a strategy with a command, which might be -
    ShowChartTraderGraphics();

    #2
    Dave,

    You could try using Ray's and Triangles here, however I will make a suggestion to our development team on your behalf and get you a suggestion tracking ID.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Dave,

      Your suggestion has ID : 1947
      Adam P.NinjaTrader Customer Service

      Comment


        #4
        Hi AdamP.
        Thanks for your suggestions about Rays and Triangles. I did try, and may have gotten somewhere were it not for the fact that the Chart Trader is able to plot on top of the price bars, but NT draw commands place lines, text etc behind the bars, so obscuring my text. Do you know of a way round this?

        Thanks
        Dave

        Comment


          #5
          Originally posted by DaveS View Post
          Hi AdamP.
          Thanks for your suggestions about Rays and Triangles. I did try, and may have gotten somewhere were it not for the fact that the Chart Trader is able to plot on top of the price bars, but NT draw commands place lines, text etc behind the bars, so obscuring my text. Do you know of a way round this?

          Thanks
          Dave
          This might help: http://www.ninjatrader.com/support/f...94&postcount=2

          Comment


            #6
            Thanks very much for that Radical. Just what I wanted.

            Comment


              #7
              Spoke too soon. It makes no difference what I set ZOrder to, I ve tried loads of different values. It makes no difference at all that I can see.

              Comment


                #8
                Dave,

                Generally the ZOrder should affect where these are plotted, i.e. it changes what "layer" the object is in. Could you post a small code snippet of the section where you draw these objects?
                Adam P.NinjaTrader Customer Service

                Comment


                  #9
                  Hi Adam.
                  I'm trying to mimic the Chart Trader graphics as close as possible. Sorry, its difficult to get it nicely indented in here. The price bars plot on top of the text and line, obscuring the text.


                  {
                  EntryOrder = SubmitOrder(0, OrderAction.Buy, OrderType.Limit, Quantity, LongOrderPrice, 0, "", "BuyOrder");

                  TradeNumber++;

                  DrawText("EntryOrderText", false, "Buy LMT", 7, LongOrderPrice, 2, Color.Black, regularFont, StringAlignment.Center, Color.Black, Color.LimeGreen, 10);

                  DrawLine("EntryOrderLine", false, 5, LongOrderPrice, 0, LongOrderPrice, Color.Cyan, DashStyle.Solid, 2);
                  }

                  Comment


                    #10
                    Dave,

                    I have found a thread that may be helpful :



                    It looks like others had a similar issue, but Koganam seems to have solved it using ZOrder with different numbers than 1,2,3, etc.

                    It looks like you can set ZOrder in Initialize()

                    Code:
                    ZOrder = 1;  //set here
                    Also, if you are setting the ZOrder from the chart, its possible that the drawing objects are not set to have a separate ZOrder from the indicator.

                    I believe things like IText inherit IDrawObject. If you look at the IDrawObject info in the help guide :



                    You can see there is a "SeparateZOrder" setting that allows you to change whether a drawing object has the same ZOrder as the indicator/strategy, or if it can be set separately. So for example :

                    Code:
                    IText drawntext = DrawText("EntryOrderText", false, "Buy LMT", 7, LongOrderPrice, 2, Color.Black, regularFont, StringAlignment.Center, Color.Black, Color.LimeGreen, 10);
                    
                    drawntext.SeparateZOrder = true;
                    Last edited by NinjaTrader_AdamP; 08-29-2012, 07:48 AM.
                    Adam P.NinjaTrader Customer Service

                    Comment


                      #11
                      Thanks Adam.
                      ZOrder = 100; gets my lines in front of the price bars.

                      Comment


                        #12
                        Dave,

                        No problem, glad I could help.
                        Adam P.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Brevo, Today, 01:45 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post Brevo
                        by Brevo
                         
                        Started by aussugardefender, Today, 01:07 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post aussugardefender  
                        Started by pvincent, 06-23-2022, 12:53 PM
                        14 responses
                        239 views
                        0 likes
                        Last Post Nyman
                        by Nyman
                         
                        Started by TraderG23, 12-08-2023, 07:56 AM
                        9 responses
                        384 views
                        1 like
                        Last Post Gavini
                        by Gavini
                         
                        Started by oviejo, Today, 12:28 AM
                        0 responses
                        6 views
                        0 likes
                        Last Post oviejo
                        by oviejo
                         
                        Working...
                        X