Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

continuum - cqg

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

    continuum - cqg

    Hello,

    I have a question please.

    I´m running the same script on 3 co-located servers, all side by side. All with the same internet connection.

    The 2 servers connected to continuum have a 1-2 seconds time delay on executions in the executions-tab slower than the cqg.

    My question is, if continuum is a subset of cqg why is it slower.


    Thank you!
    Tony

    #2
    tonynt,

    Thanks for your post.

    I'd like to see your log and trace files. Please send me a note to platformsupport (at) ninjatrader (dot) com. Attach your most current log and trace files to the email, and put a link to this forum post in the body of the email. Please note "ATTN: Drew" in the body of the response.

    You will find the log file on your PC in the (My) Documents > NinjaTrader 7 > Log folder.

    The log file will be named "log.20171203.txt"

    You will find the trace file on your PC in the (My) Documents > NinjaTrader 7 > Trace folder.

    The trace file will be named "trace.20171203..txt"
    Drew O.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you for your reply. I can not send you the files, I only could send you snippet of the lines at that time. But I think this is not what you want.

      Let me do another question referring speed please: I want to read between servers as fast as possible. My collegue and me set this up with sharing folders (instead of Dropbox as we did untill now).

      For doing the reading faster I put streamreader from onbarupdate to onmarketdata but to my surprise there is no change in speed. Is it possible that "onmarketdata" does refer only to the "onmarketdata" and has nothing to do with faster actions like faster reading from a file (on same pc or server)?

      Thank you!
      Tony

      Comment


        #4
        Hello,

        Thank you for the post.

        The read speed of the computer would have nothing to do with OnMarketData. The OnMarketData override is called for Market Data events specifically and is not related to your PC or read/write speed.

        Regarding seeing delays between the computers, this can be caused by a variety of factors. One item may be the PC clock on each pc, if one was out of sync the other two would not directly match it. There can also be other factors such as your logic, the PC hardware used, data requested.

        You would need to identify first if all events and data leading up to the fill were identical on each machine to understand if the timing should be the same. If your script uses tick data, it is also possible that if one script is enabled slightly before another, they may not have the same starting data which could lead to differences in fills or conditions becoming true.


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

        Comment


          #5
          Hello,

          thank you for your reply and suggestions.

          Referring onmarketdata I have another question please: I´m running the script on COBCtrue which I need for calculations in different dataseries. Everything working fine but there is one thing I could not find a solution for: how can I have the Low of eg a current 1-Minute-Bar that is not finished yet (if finished then of course with Lows[dataseries][0]. Because of COBCtrue it will not work in onbarudate I assume, what could I do in onmarketdata please to get this double. Or any idea for a workaround?

          Thank you!
          Tony

          Comment


            #6
            Hello,

            Thank you for the reply.

            When using COBC = true, you would only be able to retrieve the last closed bar of that series. To get the current Price you could use OnMarketData but that would not tell you if that is the low of the current building bar, that would just be the last price.

            To gather the current low, you could use logic. If you are using OnMarketData in combination with OnBarUpdate, you can use OnBarUpdate to reset variables you populate from OnMarketData.

            For example, after the 1 minute bar closes, you could reset a variable from OnBarUpdate to let OnMarketData know a bar has closed. In OnMarketData, you can check if the current last price is lower than the stored price, if so set the variable to the new lower price, if not use the last price as it is the low.

            Here is a simple example of using both overrides:

            Code:
            double lowPrice;
            bool reset;
            protected override void OnMarketData(MarketDataEventArgs e)
            {
            	if(e.MarketDataType == MarketDataType.Last)
            	{
            		if(reset)
            		{
            			lowPrice = e.Price;
            			reset = false;	
            		} else if(e.Price < lowPrice)
            		{
            			lowPrice = e.Price;
            		}
            		Print(lowPrice);
            	}
            }
            
            protected override void OnBarUpdate()
            {
            	reset = true;
            }
            This assumes only one series, for multiple series you would need to fill in the logic for that use case.

            Please let me know if I may be of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Hello Jesse,

              thank you for this reply. Can you please shortly give me an idea where/how to add when using multiple dataseries and I need eg Low of dataseries 2 of current (not yet finished) bar. I know how to use multiple dataseries usually in onbarupdate but I dont understand how to use in this solution.

              Thank you for your support!
              Tony
              Last edited by tonynt; 12-05-2017, 04:18 PM. Reason: translation error, clearifying

              Comment


                #8
                Hello,

                Thank you for the reply.

                The same multiseries considerations would take place using this sample, you would just need to fill in your logic and do the bool reset for the series you want to use this logic for. You can use BarsInProgress from OnBarUpdate to delegate that logic.

                if(BarsInProgress == 1)
                reset = true;

                Please let me know if I may be of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Jesse,

                  thank you for your reply! I thought something else maybe also in onmarketdata.

                  Thank you for your support!
                  Tony

                  Comment


                    #10
                    Hello Jesse,

                    I think I have to run the script COBCfalse. How do I get the calculation for the low when script is COBCfalse please. I thought to do with
                    if(BarsInProgress == 1 && FirstTickOfBar)
                    reset = true;

                    but then it will not give the low of the currentbar when bar not finished yet, it will only return a value when bar is closed.

                    From your example above what would I have to do in onbarupdate (or whereever) please for getting the low of the currentbar bar before the bar is finished with script in COBCfalse.

                    Thank you!
                    Tony
                    Last edited by tonynt; 12-11-2017, 07:33 AM. Reason: translation error, clearifying

                    Comment


                      #11
                      Hello,

                      Thank you for the reply.

                      The example I had provided was specifically for the case of using COBC = true. If you are now using COBC = false, you should be able to just use the Low[0] to retrieve the current building bars low. In a multi series script, you can see the low of any given series using the Lows[BarsInProgress][0] syntax.

                      If you are stuck somewhere between a prior example and a new question, I would suggest showing the syntax you are now trying along with the output from your tests. If you have not conducted any tests yet for this question, I would suggest to put together a sample and then relay that along with your output.

                      Please let me know if I may be of additional assistance.
                      JesseNinjaTrader Customer Service

                      Comment


                        #12
                        Hello Jesse,

                        thank you for your reply. So its pretty easy to do and I was not aware of that. Sorry.

                        Please let me ask a question for fully understanding (even I work with multiple dataseries for months) because I´m experiencing an issue now with COBCtrue. Lets say I add 3 dataseries and so I do in onbarupdate: if (Historical || CurrentBars[0]<1 || CurrentBars[1]<1 || CurrentBars[2]<1 || CurrentBars[3]<1) return;

                        What I see is that the conditions that are true eg BarsArray[2] with Range-2-Bars will not trigger in the script that is running in a 5 min chart. I do as usual if(BarsInProgress==2 &&....). I have for debugging rectangles, horizontal lines and Backcolor to see return of ints, doubles and bools but they are not plotting. The conditions from the added dataseries are only plotting and triggering when I run the script COBCfalse (and adding to my conditions FirstTickOfBar).

                        What might I´m missing please. Does the COBCtrue of primary dataseries have impact to the added dataseries so that its 100% working OK when script is COBCfalse but not with COBCtrue? (but I think COBCfalse is more CPU intensive and also I want to use it finally correctly)

                        Thank you!
                        Tony
                        Last edited by tonynt; 12-11-2017, 03:46 PM. Reason: translation error, clearifying

                        Comment


                          #13
                          Hello,

                          Thank you for the reply.

                          From the details I couldn't really say what may be happening, I would suggest creating a simple example that shows what you are trying and provide a situation to test that. Without knowing the details of the syntax being used it would be difficult to guess what may be wrong.

                          Regarding your question on COBC
                          Does the COBCtrue of primary dataseries have impact to the added dataseries so that its 100% working OK when the script is COBCfalse but not with COBCtrue?

                          Yes, this affects the whole script. Setting COBC=false switches to a tick by tick processing which affects the whole script. The prior example was in reference to your question of using COBC=true which is why the reset works. Using COBC=false would make the logic reset on each tick so no accumulation should occur. I would suggest using Prints to see how the script is executed in both cases of COBC true/false so you can judge what may need to change with your logic.

                          Please let me know if I may be of additional assistance.
                          JesseNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by maybeimnotrader, Yesterday, 05:46 PM
                          4 responses
                          23 views
                          0 likes
                          Last Post maybeimnotrader  
                          Started by frankthearm, Today, 09:08 AM
                          6 responses
                          24 views
                          0 likes
                          Last Post frankthearm  
                          Started by adeelshahzad, Today, 03:54 AM
                          5 responses
                          33 views
                          0 likes
                          Last Post NinjaTrader_BrandonH  
                          Started by stafe, 04-15-2024, 08:34 PM
                          7 responses
                          32 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by merzo, 06-25-2023, 02:19 AM
                          10 responses
                          823 views
                          1 like
                          Last Post NinjaTrader_ChristopherJ  
                          Working...
                          X