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

About tick replay of T&S for indicator

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

    About tick replay of T&S for indicator

    Hello again, i try to create an indicator which will show T&S blocks on my chart.
    My logic is
    1)Get number of bars on chart- Done
    2)Get Time from the first bar(StartTime)- Done
    3)Loop from StartTime (ex. 08:00 PM) to the current (ex 09:00) and get volume tick by tick
    4)Check and separate Bid from Ask traded volume-Done
    5)Loop for each price to create Blocks(aggregate vol )

    I already have read a couple free indicators like Footprints and Volume Profiles to understand how they to it with tick replay. But no luck everyone uses its own logic.

    My question here it is that if can set a time like 08:00 PM and get from that moment each tick until current time or an other specific time? and if yes how i loop that ?

    Thank you.

    #2
    Hello stoxos,

    Thanks for opening the thread.

    After looking into this, I cannot come up with an ideal way to do this without Tick Replay and instead using a 1 tick secondary series.

    I am consulting with my coworkers further to see if this could be possible.

    In the meantime, the suggested route to do this is to use Tick Replay and then construct your dictionary in OnMarketData().

    Our VolumeProfile indicator does this at line 125 you can reference this indicator in the NinjaScript Editor:

    Code:
    if (Bars.IsTickReplay)
    {
    	if (e.MarketDataType == MarketDataType.Last)
    	{
    		price	= e.Price;
    		volume	= e.Volume;
    
    		if (!cacheDictionary.ContainsKey(price))
    			cacheDictionary.Add(price, new VolumeInfoItem());
    
    		volumeInfoItem = cacheDictionary[price];
    
    		if (price >= e.Ask)
    			volumeInfoItem.up		+= volume;
    		else if (price <= e.Bid)
    			volumeInfoItem.down		+= volume;
    		else
    			volumeInfoItem.neutral	+= volume;
    	}
    }
    Additional info on developing for Tick Replay can be found here: https://ninjatrader.com/support/help...ick_replay.htm

    If you have any additional questions regarding Tick Replay, please don't hesitate to ask. Otherwise, I will follow up with you after I have gotten more word about doing such with a 1 tick secondary series.
    JimNinjaTrader Customer Service

    Comment


      #3
      First of all thank you for the quick and right answer.

      Second my English are bad so what i want is to of course use tick replay i just didnt know what to loop , but in the answer you gave me you said something important that is not mentioned and should be ADDED here https://ninjatrader.com/support/help...ick_replay.htm

      You said suggested route to do this is to use Tick Replay and then construct your dictionary in OnMarketData(). and after that i gone back to the volume profile example and show that tick replays ticks are put on a dictionary and then you do what ever you want with that , i just didn't know that thing, thats why i was looking for a loop in the code.

      And now i am able using tick replay to print to output each tick from the start of a session.

      So thank you very much!

      I hope we helped others with tick replay cause for a beginner is a bit confusing when it is so simply at the end.

      Comment


        #4
        Hi, i face a problem an issue basically i a have a modded version of NT8 volumeprofile.
        I use tick replay and when i print all the ticks from the begging of the first bar i get each tick twice in my output. OF course i dont have forgot any other print. Here is an example
        I print ask ticks only. And there is the issue.


        Thank you again!
        Last edited by stoxos; 08-26-2017, 11:49 AM.

        Comment


          #5
          Hello stoxos,

          Thanks for your reply.

          If I understand correctly, the issue is that your indicator is printing all of the expected data but is not displaying it properly when applied?

          I don't think I have enough information on how you are doing things to assist you further right now. As this is a modified version of our Volume Profile Indicator, I would suggest to compare results with a vanilla version of the Volume Profile Indicator and first compare prints before comparing plotted data to ease troubleshooting.

          We don't offer debugging services within the scope of services that we provide, but we can get you connected with a member of our business development team for a list of consultants if you are looking for someone to assist in debugging the code. If that is the case, please let me know.

          If you have discovered an issue with NinjaScript itself and would like to report it further, we will gladly accept a reduced sample that explains the issue in simple terms.

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

          Comment


            #6
            OK i just started it from the start. And that solve my problem. I dont know what was wrong with that version but now is everything fine!

            Thank you again

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by GussJ, 03-04-2020, 03:11 PM
            15 responses
            3,268 views
            0 likes
            Last Post xiinteractive  
            Started by Tim-c, Today, 02:10 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Taddypole, Today, 02:47 PM
            0 responses
            2 views
            0 likes
            Last Post Taddypole  
            Started by chbruno, 04-24-2024, 04:10 PM
            4 responses
            50 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by TraderG23, 12-08-2023, 07:56 AM
            10 responses
            401 views
            1 like
            Last Post beobast
            by beobast
             
            Working...
            X