Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Paint unmovable shapes

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

    Paint unmovable shapes

    Hi,

    I am new to Ninja and NinjaScript, and I have checked in the 6.5 documentation but could not so far find an answer or example for the task I want to do:

    My simple MA crossover strategy places drawing tools over the chart when a signal is produced, for example:

    Code:
           
    protected override void OnBarUpdate()
    {
         if (CrossAbove(EMA(Fast), EMA(Slow), 1))
         {
             DrawVerticalLine("My Line" + CurrentBar, 0, Color.Gainsboro, DashStyle.Solid, 5);
    ............
    .......etc
    However the produced VerticalLine-s over the chart can be activated with a single mouse click. I also saw the same behavior with HeikinAshi indicator (all parts of it are movable by the mouse).

    Is there a way that I could make the line "un-clickable" i.e. to prevent it from being accidentally dragged?

    Also, the lines are drawn over the bars, and completely cover them, which is not quite acceptable. How to overcome this?


    If these tasks can not be achieved by placing drawing objects could anyone point me to example(I have some programming skills) where I can draw directly on chart's background?

    Any help is really very much appreciated!
    chris

    #2
    Chris,

    To achieve this you will need to use NT7 and lock the object you have set.

    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thank you Josh for your prompt response!

      I will get NinjaTrader 7 and rewrite my strategy for it.

      BestRegards,
      chris

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      152 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      89 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      131 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      127 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X