Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to subscribe and get price change.

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

    How to subscribe and get price change.

    Hello,
    PLEASE BE VERY SPECIFIC.

    I know there is a method called OnMarketData() available for a strategy.
    Then I am developing an API application, that should get each price change.
    So far I did not manage to see the above method is triggering.

    Data Feed:
    I did not find a way to debug the strategy code.
    I saw somewhere that I need to attach to process from my VS app, then I had to open the strategy.cs file, and put my Breakpoint on VS, then the code was suppose to stop there.
    I did not manage to do it.
    If you have a very Detailed instruction on how to do it, it will help to pass one barrier.


    Price Change:
    Then after I pass the feed issue, then I need to get into my VS code, to a handler, the price change.
    So, I could never check and see how to even subscribe to the OnMarketData() method...
    So, please help with that as well.
    My plan is to get the change of price to this method, then from it to open a socket and send the information back, from my C# Strategy code to my VS C# code.

    Or(another idea), when I add the custom.dll as a reference, and when I compile with NT, the dll is getting updated, and the name of the strategy become a class inside this dll.
    Then I can add a hendler in this dll, and delegate this handler in my VS code, then only from the strategy, to send the object MarketDataEventArgs on to the handler, that will be passed on to my VS C# code, and from there to make decisions for the strategy.

    Please be specific in your responses. Usually responses are short and laconic (sorry).

    Thank you in advance,
    Isaac (is the name)

    #2
    Hello,

    Thank you for the post.

    I first wanted to mention, using visual studio for debugging assumes you already have knowledge of how to use visual studio very well. Our support can only provide basic instructions for visual studio as this is an outside development program.

    The process to attach NinjaTrader to visual studio can be found here: http://ninjatrader.com/support/helpG...isual%2Bstudio

    These would be all the steps required to attach to NinjaTrader for debugging using break points. If you are having difficulty in following the steps or getting it to work correctly, I would need to know at which step you are having trouble and we could work from there.

    So, I could never check and see how to even subscribe to the OnMarketData() method...
    NinjaTrader uses override methods which the platform drives based on incoming market data. For a script to subscribe to OnMarketData, you would just need to add this override to the script you are using. A sample can be found in the help guide here of the syntax needed: http://ninjatrader.com/support/helpG...b=OnMarketData

    You can also see a working example of this method by viewing the VolumeProfile indicator that is included with the platform, specifically line 95.

    My plan is to get the change of price to this method, then from it to open a socket and send the information back, from my C# Strategy code to my VS C# code.
    I am unsure of what you are trying here, but you can certainly try to use general C# concepts such as sockets, these type of items would be outside of what we could provide support for though as this is general C# programming. NinjaTrader uses C#, so any item you would like to test you certainly can using the NinjaScript editor.

    Or(another idea), when I add the custom.dll as a reference
    Please do not add the NinjaTrader.Custom.dll file as any reference, this file is used internally and is the compiled output of all NinjaScript items. if you block the platform from replacing this file, compiles will not be successful. There is no need to ever reference or use this file.

    Unfortunately by the descriptions of the items you are trying I am unable to determine what the end result you are looking for is. If you can specify what you are trying to accomplish in total, it may be more apparent what needs to be done to accomplish those goals.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by FrazMann, Today, 11:21 AM
    0 responses
    3 views
    0 likes
    Last Post FrazMann  
    Started by geddyisodin, Yesterday, 05:20 AM
    8 responses
    52 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    10 responses
    36 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by DayTradingDEMON, Today, 09:28 AM
    4 responses
    24 views
    0 likes
    Last Post DayTradingDEMON  
    Started by George21, Today, 10:07 AM
    1 response
    19 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Working...
    X