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

Get datetime and price on mouseclick and write to text file

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

    Get datetime and price on mouseclick and write to text file

    Hi,
    Newbie here

    I explored NT8 for few days to this point
    and I wanted to put something together, for learning purposes:

    1. click on chart
    2. get time and price information under mouse
    3. write them into a text file

    i'm not even sure if this must be an indicator, or ... a drawing tool?


    I browsed quite a lot the docs, but right now i'm confused to be honest.



    I would guess i have to use some of these statements / functions that i found in docs:

    chartControl.MouseDownPoint;
    chartControl.MouseDownPoint.X.ConvertToHorizontalP ixels(chartControl.PresentationSource);
    ChartBars.GetBarIdxByX
    StreamWriter writer = new StreamWriter("some_file.txt");

    but right now I'm clueless of how to put this together.


    Can someone help me with some pseudocode, and some pointers about how to organize all this?

    I presume i would have to write inside the OnMouseDown() event?
    Do i have to take care of DrawingState or something?

    I still try to figure out the structure i need, but docs are too complex for me right now, too much info and terms.
    I hope someone can help me get this done faster
    Last edited by mishhh; 11-18-2017, 05:29 PM.

    #2
    Hello mishhh,

    There are a few examples on the forums I am linking below.

    Mouse coordinates to price and time - http://ninjatrader.com/support/forum...045#post513045

    Writing to file reference sample - https://ninjatrader.com/support/foru...ead.php?t=3475
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Haiasi, 04-25-2024, 06:53 PM
    2 responses
    16 views
    0 likes
    Last Post Massinisa  
    Started by Creamers, Today, 05:32 AM
    0 responses
    4 views
    0 likes
    Last Post Creamers  
    Started by Segwin, 05-07-2018, 02:15 PM
    12 responses
    1,786 views
    0 likes
    Last Post Leafcutter  
    Started by poplagelu, Today, 05:00 AM
    0 responses
    3 views
    0 likes
    Last Post poplagelu  
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,407 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Working...
    X