Strategy based on various of Data?
28.06.2020 19.13

Creating Flexible Strategy Architecture in NinjaTrader 8

NinjaCoding friend

Hi Yuri!

It will be very useful if Yuri can provide some simple code examples (even potential future courses) of how to use each of the follow dataset as part of the simple strategy entry signal:

- News

- Economic Data / Announcement

- Level 2

- Superdom

Very very looking forward Yuri!

  • Yuri Zolotarev
    29.06.2020 16:11

    If you go to Kinetick you will see this for the news. No idea though what sort of format that arrives in NT. I would say you need to talk to them. Best case is that each fundamental arrives same as any symbol. What I mean is ie. ES arrives in a format as in Open Close etc., fundamental data can come in with just a single value eg. announced unemployment rate. So all you have to do in this case would be AddDataSeries(unemployment fundamental ticker name). However that is the best case, the other case could be that data simply lands in the news feed add on of ninjatrader in a string format and from there you can't do much but just read it or hack into NT somehow to parse it for some keywords and do something which is real wicked.

    So that was to do with your question about news or economic data. I would say much more chance you find the economic data in the format I described rather than news because economic data is just a number and you can work with that number. News is text. Also, another thing you can do with news is make some sort of GET request to some news server inside your indicator and do things from there. Again, there has to be some sort of algorithm either made for you by the news provider or inside your code that is going to parse stuff and decide what to do. Eg. you can parse the news for word Elon Musk and and stop trading everytime he is mentioned with the word "said" if you are trading Tesla stocks. 

    Level 2 data is simply your best bid and ask which is easily accessed inside your strategy code using GetCurrentBid or GetCurrentAsk command. Superdom or Level 3 data is also easily accessed inside protected override void OnMarketDepth(MarketDepthEventArgs marketDepthUpdate) where you can easily get notified everytime the ladder position is changed inside the dome.

    Hope this helps!

  • NinjaCoding friend
    29.06.2020 17:22

    Awesome. This is very helpful! Thank you Yuri!