• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom drawing from indicator

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

  • Alexik30
    started a topic Custom drawing from indicator

    Custom drawing from indicator

    Hello all,
    I would like to ask you for any help. I use NT7. I need to draw a ray on chart within indicator.
    I have toolstripbutton and if I press it I want to draw the ray.
    I tried to use DrawRay method, it works well. But if I press F5 (reload script) my ray disappers - I dont need it.
    So I tried to use other way - code below (item is a my class reference with all values for the ray):

    Gui.Chart.ChartRay _chartray = new Gui.Chart.ChartRay();

    _chartray.Anchor1Time = item.StartPointTime;
    _chartray.Anchor1Y = item.StartPointY;
    _chartray.Anchor2Time = item.EndPointTime;
    _chartray.Anchor2Y = item.EndPointY;
    _chartray.Locked = false;
    _chartray.Tag = item.Tag;
    _chartray.Selectable = true;
    _chartray.VisibleOnInstrument = Instrument.FullName;

    ChartControl.ChartObjects.Add(_chartray);

    It works perfect and the ray is on the same place after reload. But it is not possible to move it manually from chart. It is not locked, but it behaves like it is. If I open contextmenu and Properties... and then pres OK, ray movements are possible.
    I know this is out of your support, but PLEASE help me somehow. It must be some trick to do that.

  • NinjaTrader_PatrickH
    replied
    Hello Alexik30,

    Thank you for your response.

    You would use custom plotting instead in order to draw the values you wish. Take a look at the example under Tools > Edit NinjaScript > Indicator > CustomPlotSample.

    Leave a comment:


  • Alexik30
    replied
    Hello Patrick, thank you veru much for your reply. I know this code, but I dont need to use shortcut for drawing. I need to draw a ray according to values let's say from extrenal data file. That's why Im finding the way how to draw it by script with manuall adjustments possibility. I need to draw the ray (or whatever) to be on the chart and save it to the workspace..the same way as I drown it by hand.
    I can use the code I posted before, but I need to know just the trick how allow changing anchor1 and anchor2 points in the chart manually which seems to be "locked".

    Bets regards,
    Alex

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello Alexik30,

    Thank you for your post.

    There is an example of using a custom toolstrip's buttons to draw items at the following link: http://ninjatrader.com/support/forum...d=6&linkid=530

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by StevenNelson, Today, 12:23 PM
1 response
7 views
0 likes
Last Post NinjaTrader_PatrickG  
Started by kokobeef, Today, 12:32 PM
2 responses
10 views
0 likes
Last Post kokobeef  
Started by Jackrpo, Today, 11:14 AM
2 responses
11 views
0 likes
Last Post Jackrpo
by Jackrpo
 
Started by DariusDeck, Yesterday, 04:22 PM
7 responses
49 views
0 likes
Last Post NinjaTrader_ChristopherJ  
Started by laszlonagy, Today, 09:28 AM
2 responses
10 views
0 likes
Last Post laszlonagy  
Working...
X