Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Idea for study to plot an instrument chart sliced in cycles & in dollar change terms

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

    Idea for study to plot an instrument chart sliced in cycles & in dollar change terms

    Hello

    I need guide about a starting point to create a study or a kind of “indicator” to plot let’s say the ES (S&P future), but the plot need to be generated within 2 conditions:
    • The condition 1 is the chart plot be starting from 0 in a specified cycle, let’s say monthly cycle.
    • The condition 2 is the chart plot be in dollar change starting in $0 at the beginning of the defined cycle.

    Let’s put an example:
    Specifying and using the cycle called ‘Month’, it means the chart will show from Sunday to Friday the plot of the ES, starting in $0 on Sunday at the open market time, and after this the study will start drawing the chart just as the ES does, but the generated chart instead to be drawn as a standard chart, let’s say plotting:
    4,100.00
    4,100.25
    4,100.50
    4,100.25
    4,100.00
    4,099.75
    4,099.50


    Instead of that, the ES quote values the indicator would generate are the ES changes from the beginning of the cycle, just as a normal chart but not showing the real quotes, no, showing the tick dollar value changes:
    $0.00
    $12.50
    $25.00
    $12.50
    $0.00
    -$12.50
    -$25.00

    … and so on until the last tick at the end of the specified kind of cycle, in this case on Friday at the market close time.

    I don’t know how start to work with this, to take the ES quote, to specify that the chart be divided by cycles, like a kind of slices of the ES standard chart, then specify it need to start from $0 and after this keep plotting and drawing the chart but in terms of dollars change from the start point.

    I haven't seen anything similar to take it as a starting point and I would
    like to ask to the person that will give the answer, that please ask to the others coworkers in the development area to see if someone could provide maybe a template or any code portion with which I could start

    Thank you
    Last edited by futurenow; 05-03-2021, 12:01 PM.

    #2
    Hello futurenow,

    Thank you for your post.

    It's a little unclear exactly what you're looking for here. What it sounds like you're wanting is getting the netchange from an arbitrary starting point and plotting it, is that correct?

    You could use time checks or date checks to reset your "cycle" when you wish and set a private variable to 0 at each reset. You could then add the difference in prices divided by TickSize to that variable as more bars develop and plot the resulting values.

    I wouldn't have any examples that would be specific to this, however. If that's not quite what you're looking to do, can you provide a mockup of what you're looking for?

    Thanks in advance: I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your quick reply Kate,

      Originally posted by NinjaTrader_Kate View Post
      It's a little unclear exactly what you're looking for here. What it sounds like you're wanting is getting the netchange from an arbitrary starting point and plotting it, is that correct?
      I will attach 2 pictures for better understand the kind of result the indicator should show, just as example. But yes, I think "netchange" could be the keyword when I talk about “dollar change”. In the pictures you can confirm this. In this case, getting the netchange of ES from a defined specific staring point to an ending specific point, i.e. if the cycle is monthly (every month), then the cycle starts the first tradable day in the month and ends the last tradable day in that month.


      You could use time checks or date checks to reset your "cycle" when you wish and set a private variable to 0 at each reset. You could then add the difference in prices divided by TickSize to that variable as more bars develop and plot the resulting values.
      Now you see the attached pictures and having a better idea about the result, is there a thread, a template or any kind of starting point I could use to start to complete the code with the details I need?

      I tried going to https://ninjatraderecosystem.com/user-app-share/ but there are around 900 indicators, so if you or your coworkers could please provide that starting point it will be a light in the darkness for me In case you don’t remember any example, please ask to the developers if possible.


      I also made a search in https://ninjatrader.com/support/help...erence_wip.htm but I couldn’t find ‘time checks’ or ‘date checks’ to see some examples about how they work, because I haven’t seen or used them for now.

      A staring point could be the code portion, or even a more complete example or examples about:
      • How to set the instrument, in this example the ES future
      • How to convert the ES quote to netchange shown as dollar value, that it would be something like multiplying the ES tick moves per 12.50 to show the dollar value change in every moment, tick-by-tick in real time or in market replay.
      • And how to set the cycle specifying in the code if the cycle is ‘Month’, then start at the every tradable day when you find a new staring month, and then ends the cycle at the end of that month. Then reset the plot to 0 and do the same again with the next month, and so on.

      I’m still learning in the indicators development process, and normally once I obtain a guide, or example or starting point with some code portions examples, normally I’m able to continue, sometimes with help, some others times slowly, but improving step by step, so thank you Kate.

      Click image for larger version

Name:	Standard chart with comments.png
Views:	48
Size:	142.2 KB
ID:	1154673

      Click image for larger version  Name:	Chart based in Dollar change within cycles - 1.png Views:	0 Size:	97.5 KB ID:	1154539


      Click image for larger version  Name:	Chart based in Dollar change within cycles - 2.png Views:	0 Size:	200.1 KB ID:	1154538





      Last edited by futurenow; 05-04-2021, 05:00 PM.

      Comment


        #4
        Hello futurenow,

        Thank you for your reply.

        Just to be clear, in platform support, we do not create/write strategies, we do not provide debugging services. We also cannot provide programming education services. If you would like the strategy created for you, we can provide references to 3rd party programmers who could meet your needs.

        That being said, I usually suggest if you're not familiar with using DateTime objects to create time and date comparisons, that you set a few up in a Strategy Builder window and unlock the code to see how they are structured:

        https://ninjatrader.com/support/help...imeComparisons

        This example from our help guide goes into how you can manipulate DateTime objects to use for comparisons:

        https://ninjatrader.com/support/help...me_objects.htm

        As we do not have any examples of what you're looking for, I will see if I can come up with a very basic example you can use for a starting point, however, this will not be completed today. Please note that the samples we provide are intended to give you further direction to move forward, and are not intended to be used for copy and paste purposes.

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Thank you Kate

          As we do not have any examples of what you're looking for, I will see if I can come up with a very basic example you can use for a starting point, however, this will not be completed today. Please note that the samples we provide are intended to give you further direction to move forward, and are not intended to be used for copy and paste purposes.
          I just can say thank you for the example you talk about to use as starting point, and yes, I understand it can take time not being ready today.

          And about what you comment, yes, I understand what you explain, and my questions were just for that, to have an starting point with which to take some ideas and after that to be able to start to develop the concepts I could have in mind. For that reason I asked you to know if in any of your sites is there anything that could be used to take one or more ideas because I thought that among hundreds of indicators it could be something maybe not similar but that could show for example how is the process to take the quote data from a ticker (in this example the ES) showing how to work with this data in the way you need, in this case for example checking for each tick move and representing and plotting that in a chart in dollar value change (net change) instead of the ES current chart value that for example at this moment I see is 4,158.25.

          So, as after you could check the pictures with the mock-up idea you could confirm there is not examples about what I'm looking for, then I really appreciate you taking the time and dedication to provide an example as starting point.

          Just one final note, in the main question an extra picture is now submitted, just to see what would be the original standard chart form, from which the indicator would "convert" to the way I describe. In others words to better see what would be the original plain form a chart is shown, and then the "conversion" (if is the correct way to say this) the indicator would make and plot as result.

          Thank you very much

          Comment


            #6
            Hello futurenow,

            Thank you for your patience.

            I've created an example indicator that modifies the Candlestick Indicator Example from our publicly available User App Share found here:

            https://ninjatraderecosystem.com/use...cators-sample/

            The version below is modified to show each bar's net change in price over a monthly span and resets to 0 at the beginning of each new month. You could modify this to use different reset intervals, perhaps weekly or per session. The linked indicator above is helpful for creating indicators you'd like displayed in a Candlestick type format.

            Please let us know if we may be of further assistance to you.

            The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
            Attached Files
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Kate View Post
              Hello futurenow,

              Thank you for your patience.
              Thanks to you for taking your time and for the example you have created that it could useful for the other users too.



              I've created an example indicator that modifies the Candlestick Indicator Example from our publicly available User App Share found here:

              https://ninjatraderecosystem.com/use...cators-sample/

              The version below is modified to show each bar's net change in price over a monthly span and resets to 0 at the beginning of each new month. You could modify this to use different reset intervals, perhaps weekly or per session. The linked indicator above is helpful for creating indicators you'd like displayed in a Candlestick type format.
              I see the net change and the resets are working properly, as should, perfect! Thank you Kate! You are the best!



              Please let us know if we may be of further assistance to you.
              Yes, thank you. Now I’m analyzing something, there is a process I do manually and I think it could be more efficient if it is done directly by code. Ok, that process is I plot some overlaid symbols, for example 2 symbols like the ES and the CL, both in the same chart panel, and each one independently from the other, so basically what is called "overlaid". Well, what I actually do to get that result is to add the indicator twice and plot the resulting charts both in the same panel, which visually provides a good result but in fact what is running in the background is the same indicator twice and I would like to have the way to get that kind of plots with only 1 single indicator, because if I need 3 symbols then what is needed is an extra 3rd instance of the indicator, which is not efficient.

              I tried to search in the Ecosystem site but I couldn’t find any idea to use as base to start to work with:
              https://ninjatraderecosystem.com/use...earch=overlaid

              I will leave a picture to have a visual idea about the result I’m explaining for a 2 overlaid symbols example.

              Click image for larger version

Name:	Visual illustration - 2 overlaid charts (ES and CL).png
Views:	40
Size:	63.4 KB
ID:	1156705

              Comment


                #8
                Hello futurenow,

                Thank you for your reply.

                This wouldn't be possible as you can't plot in different scales from the same instance of an indicator. They'd all have to be on the same scale - one part couldn't be left justification and another part on Overlay justification. Your best bet would be to use an instance of the indicator for each data series and use the overlay function to overlay them on top of each other.

                Please let us know if we may be of further assistance to you.
                Kate W.NinjaTrader Customer Service

                Comment


                  #9

                  Hello Kate! Thank you for your reply.

                  Originally posted by NinjaTrader_Kate View Post
                  This wouldn't be possible as you can't plot in different scales from the same instance of an indicator. They'd all have to be on the same scale - one part couldn't be left justification and another part on Overlay justification.
                  Ok, I understand your point, but for that a possible solution could be to plot all the data series in the same scale and justification, for example in this case all the symbols in “Overlay justification”. Let’s talk about a default chart example to finally try to arrive to the indicator situation, to see if we could find a solution having more details about the idea.

                  As you may know and as you can see in the first picture, you can add and apply multiple data series in a standard chart, in the picture is applied 2 Futures, ES and CL, both in the same time scale (60 min), both in the same chart panel, with the ES as the “main” or base plot and with the CL as a “secondary” plot overlaid over the ES chart, but in the indicator these could be treated basically as 2 independent plots but overlaid in the same chart panel.

                  Well, what I would like to have is a similar feature in the indicator where you can add 1, 2 or more data series (multiple ticker symbols: Futures, Stocks, ETFs), to be plotted in the same chart panel. I.e. having something similar as a default NinjaTrader 8 chart but in this case via the indicator, where you could select Ticker 1, Ticker 2, Ticker 3,… (less than 10 tickers/symbols), and about the resultant scale and justification for the indicator, they don’t necessarily have to be exactly as in the picture, because what is in the picture is just an approximate concept to have the base idea, and the tickers could be plotted in a similar way but following the NT8 scale rules, for example all the symbols in “Overlay justification” to all be under the same settings/parameters.

                  I don’t know if I’m using the right exact technical words for every case but I think now with the new description and the picture you could have a better idea about how could be the process to get the final result.



                  Your best bet would be to use an instance of the indicator for each data series and use the overlay function to overlay them on top of each other.
                  Thank you for the suggestion Kate. That was what I was thinking to do but I would like to avoid to have let’s say 30 instances of the indicator running all them at the same time to analyze different timeframes etc. when that could be done maybe with 4 instances for example, 1 instance for each timeframe.

                  Thank you!

                  Click image for larger version  Name:	Visual illustration - 2 overlaid charts (ES and CL) in standard chart and in the indicator 1.png Views:	0 Size:	410.7 KB ID:	1157383


                  Possible result for the Indicator Properties

                  Click image for larger version

Name:	Visual illustration - 2 overlaid charts (ES and CL) in standard chart and in the indicator 2.png
Views:	14
Size:	442.2 KB
ID:	1157385
                  Last edited by futurenow; 05-24-2021, 11:21 AM.

                  Comment


                    #10
                    Oh! One more clarification, if possible, ideally the Ticker Symbols in the indicator would be independent from the data series in the chart. I mean, it would be perfect if the Ticker Symbols you can choose in the in the indicator don’t necessarily need to previously be in the chart.

                    For example, you could have a simple standard chart with the SPY, and in the indicator you could select the next:

                    Ticker Symbol 1: ES
                    Ticker Symbol 2: CL
                    Ticker Symbol 3: GC

                    I.e. that ES, CL and GC are chosen in the Indicator independently of what previously be in the chart. Actually I see you can only choose only the Ticker Symbols you previously have in the chart data series, and a non-direct relationship between the chart data series and the indicator data series would be perfect, of course if possible.

                    Thank you

                    Last edited by futurenow; 05-24-2021, 11:39 AM.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by atrader, Today, 09:29 AM
                    1 response
                    5 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Started by nailui, Today, 07:26 AM
                    1 response
                    28 views
                    0 likes
                    Last Post NinjaTrader_Spencer  
                    Started by chartchartchart, Today, 08:08 AM
                    1 response
                    5 views
                    0 likes
                    Last Post NinjaTrader_Emily  
                    Started by andreslazor7, Today, 08:08 AM
                    3 responses
                    16 views
                    0 likes
                    Last Post NinjaTrader_ChristopherJ  
                    Started by FatCanary, Today, 08:09 AM
                    2 responses
                    10 views
                    0 likes
                    Last Post FatCanary  
                    Working...
                    X