Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw object position

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

    Draw object position

    Is there a way to position of a drawn object not based on price? I want my strategy to have an annotation appear at the bottom of the first panel or a separate panel. This is what I tried but with no success:

    DrawDot("My dot" + CurrentBar, false, 0, y, Color.Blue).PanelUI = 2;

    Also I can make changes in the strategy script to change the default colors of indicators but I cannot figure out how to do this for thickness, is this possible? Thanks

    #2
    I should probably elaborate a bit, it will be a task a little bit like this:

    protected override void OnBarUpdate()
    {

    if ((ToTime(Time[0]) >= 13000 && ToTime(Time[0]) < 30000))

    {
    DrawDot("My dot" + CurrentBar, false, 0, y, Color.Blue).PanelUI = 2;
    }

    Comment


      #3
      Chris001, if you drawn in the price or non price panel would be dictated by the DrawOnPricePanel property.



      You can change the width and colors of added indicators by your strategy script, yes.

      Comment


        #4
        Hi Bertrand,

        Using the following code I get the errors in the attached csv file, which is unusual since this is exactly the same as the link to the example I was provided, minus the string name was changed.

        protected override void Initialize()
        {

        Add(new Plot(Color.Orange, "Trading Times"));
        DrawOnPricePanel = false;
        }
        Attached Files

        Comment


          #5
          Hello Chris001,

          Thank you for your response.

          DrawOnPricePanel is an indicator function, it cannot be used in a strategy. If you wish to use DrawOnPricePanel you will need to create an indicator for this and Add() the indicator in the Initialize() method of your strategy.

          Please let me know if I may be of further assistance.

          Comment


            #6
            I have got it working just fine, thank you.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            55 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            142 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            160 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            96 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            276 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X