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

Newbie coding help query; Range Bar query

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

    #46
    Josh, I am sorry but after 15 years of coding TS I simply refuse to pay a consultant to show me how to change the plot color in an MA just because Ninja has a policy of not helping new people with coding difficulties, such policy being that you can hint at an answer but not provide one.

    If you guys feel fine about someone not being able to change a plot color, so be it. That is your decision.

    I showed you my code. I showed the part where the Plot is declared just like yours. Doesn't work. That code came directly from going through the MySMA tutorial. However I am trying to add changing color in relation to another MA. Simple as this is, cannot do it. You cannot help. Fine.

    Please then let me continue this thread and maybe some kind soul not constricted by Ninja Corporate Policy will help me out with this in a way that gets to a practical solution.

    Thanks.




    Originally posted by NinjaTrader_Josh View Post
    cclsys,

    I have been doing everything shy of programming it out for you. Like I said in the beginning, we cannot custom code your scripts for you. We can show you the resources of how to do it. It is up to you to ultimately get it done though. We recommend you try contacting one of the 3rd party NinjaScript Consultants here: http://www.ninjatrader.com/webnew/pa...injaScript.htm

    Your "BullishPlot" and "BearishPlot" do not exist most likely because you have not created them in the Properties region of your code. You need to expand that section and make the changes necessary. Please take a look at how it is done in the reference sample.

    Just follow the example exactly how it is shown. The only thing you need to change is the condition. The sample uses the condition of Falling and Rising. Just change those conditions to your MA cross overs.

    Comment


      #47
      cclsys,

      There is no policy here dictating not to help you. I have been trying to help you this whole time. Please understand the level of support we can offer you here. I can help point out areas of your code that are not working. I can point you in the right direction, give you hints, and show you available resources. What I cannot do is just make the indicator for you.

      In your previous posts you mentioned the error you are getting. "plot does not exist." This is the direction you can use us in. When you hit these kind of errors come to us and post your code. We can evaluate your code and tell you, "Hey, you forgot something here" or "You did something wrong there". That is the kind of help we can offer.

      That being said, we will never close out your thread and are always up for community members helping each other. Thank you for understanding.
      Josh P.NinjaTrader Customer Service

      Comment


        #48
        Originally posted by NinjaTrader_Josh View Post
        cclsys,

        There is no policy here dictating not to help you. I have been trying to help you this whole time. Please understand the level of support we can offer you here. I can help point out areas of your code that are not working. I can point you in the right direction, give you hints, and show you available resources. What I cannot do is just make the indicator for you.
        Right. Since I obviously can't understand the problem, your hints at solutions are also beyond me. The only solution that would work is to show how to write it out correctly. That you are not allowed to do as you also say above. The approach seems to be that this is like a high school where students are supposed to learn. I am just trying to get my trading chart up so I can trade. It is very hard to see the crossover sometimes and changing color would help. I am not trying to learn Ninja coding because (obviously!) I am not cut out for it. These things I have been trying to do require about 3 lines of code in TS and take less than a minute to do. I have no quarrel with Ninja script, I understand it's quite efficient at many things where TS falls short. But since it requires a C+ education, it is clearly beyond me. So be it. I have no complaints. I am just trying to get my chart to work,that's all. A simple MA plot and / or bar color change. Can't do it. Whatever it is you wrote to help the past few posts told me absolutely nothing that would help me resolve the problem.

        But since you aren't allowed to help, please let me ask others and maybe that way I will be able to have the MA change color and/or bars. I won't be able to code it myself, end of story, and once I have this done I have no intention of trying to code anything else.

        Comment


          #49
          Our policy is in place since in some cases, lines can easily be crossed between what is considered NinjaScript and what is considered general C# programming. We have a rapidly growing community and developer base and realize that providing more reference samples and help resources will only benefit us and the community. This is currently work in progress.

          I will ask one of our "in training" techs to develop a sample indicator that illustrates what you wish to do. It may be several days before its posted so please bear with us and thanks for your patience.

          Ray (President)
          RayNinjaTrader Customer Service

          Comment


            #50
            Originally posted by cclsys View Post
            "It does mean the Close of the bar. The close of the bar in a real-time bar is the latest tick of the bar. On historical bars you will of course not have the intrabar tick information. You just have the OHLC."

            Josh, thanks for clarifying that. We tried in this thread to do it, but it didn't work and that is that. Interesting exercise even if no definitive result. I am going to leave it now and just not have the capability.
            The capability is there, but it doesn't work on historical bars. The indicator framework I provided does work fine on bars that have been updated in real time.

            As to multiple colors, the easiest way to do that is to create a different plot for each color. If you look at the indicators in the file sharing area you should see examples of plots where the color changes base on direction.

            -Alex

            Comment


              #51
              Hi cclsys,

              Please find attached the SampleMultiColorMACross indicator that does what you outlined in your post below.

              The fast EMA is plotted and changing color to Blue if greater than the SMA and vice versa.

              Also you can add barcolors with the same logic to the chart (first input set to 'True').

              Enjoy and have a great day!



              Originally posted by cclsys View Post
              Josh, even though we didn't get very far with this despite Anochro and your help I did learn quite a bit, albeit mainly that I am not up to Ninja Script.

              However, I do have one more request, probably not to you since you are not allowed but to some other kind soul.

              Although I have used TS script off and on for 15 years and can do nearly anything I want with it, I am flummoxed by NS.

              I am using Ninja as a trading platform. I used a small nr. of indicators. One of which was the volume bar which was too difficult to do as we found in this thread. Ok, I can live without it.

              Right now another problem which I thought I could figure out myself remains and then I am done with setting up my trading chart.

              One thing I use is a moving average crossover to define trend. Simple, no? Well, I would like to be able to paint the fast MA one color when it is above the slow MA and a different color when it is below. I would also like the option to turn on and off the capability to paint the bars the same way.

              So the logic is as follows:

              Fast MA = an exponential moving average.
              Slow MA = Simple moving average.
              Both use the Median price.

              So if the Fast Ma is above the slow ma then the indicator and/or bar is bullish color.
              If the Fast Ma is below the slow ma then the indicator and/or bar is bearish color.

              Simple as that. I have tried about 20+ times to code this myself and got nowhere. I don't know what it is that I am not understanding about Ninja script but there it is, I can't figure out this most simple of things. I have looked at the coding for MA's, the tutorials, the index etc. etc. but I just can't do it. (Believe it or not I am supposed to have a very high IQ, but this makes me feel totally stupid!)

              So if someone could please code this for me I would be very, very grateful.
              Attached Files
              BertrandNinjaTrader Customer Service

              Comment


                #52
                Bertrand. Thank you VERY much. That is exactly what I was looking for. The changing color just helps me see when a cross is setting up intrabar since sometimes it's hard to tell (although I have learned without it to a) make the window larger (duh!) and b) have a plot concurrently that is a dot versus line which for some reason I find easier to see than just one line on another line.

                Thanks again.

                Comment


                  #53
                  BuySell indicator option for Volume Bars

                  Anachronist: sorry for late reply. Did not notice your message was more recent than other ones in my Google inbox.

                  I checked what we did and it is not quite right. The volume figures do not match the basic volume indicators.

                  However, yesterday I noticed the BuySellVolume indicator which I had initially ignored partly out of carelessness and partly because the way it is calculated I find a bit unhelpful.

                  The default code plots the sells (as positive values) and then plots the rest of the bar as the buys, the entire bar being the same as a normal volume bar with the same count. It uses bid and offer coding which I mentioned below was what I suspected was called for but not knowing the lingo could not go any further. The BuySell indicator has all that lingo.

                  I attach a change I made which takes it as far as I can go with Ninja script. Although better, it is not quite what I would prefer which is both
                  a) an indicator that shows the net up-down
                  b) paintbar which paints bullish color when buys > sells and bearish when sells >= buys and perhaps neutral when buys = sells (which hardly ever happens).

                  The way I have it now it uses the supplied Indicator to accurately calculate buys and sells which previously we didn't actually have for some reason, but I have made the sells negative so that you see both sell and buy volume separately, one above the zero and one below making it much easier to compare them and intuitively better in that increasing sell pressure makes the indicator descend versus rise. Personally I think the net is a little more helpful (assuming you already have a volume indicator up which I do), but also I like the paintbars since you can see immediately on a chart if the internal volume is diverging with price momentum which is why I like this one.

                  If you or anyone would like to take a crack at making the net buy-sell and paintbar (each as options so you can either have just paintbar or just indicator capability) I would be very grateful. The reason I can't do it is because I still can't figure out how to work around something already set up with 2 plots etc. when I only want 1, and adding in paintbar capability never compiles right despite the help I was given with it earlier. I also have a devil of a time copying one indicator already made, setting up a new one in the wizard and then pasting in the old code. Most of the time I can't get it to work which is why, after last week, I didn't touch coding for a few days until this morning when I noticed the BuySell Indicator and took a crack at copying and changing it and, by some stroke of luck, managed to make my own copy that I could then alter a little.

                  I think with Bertrand's MACross code, though, I might be able to figure this out myself but given my track record so far....

                  Since first posting this I managed to get the Net Indicator working.
                  Then I copied it and tried to make it into a Paintbar which is also working.
                  However, I can't figure out how to have the Paintbar just be standalone without having the indicator panel open up. Small thing but would be nice to get right. Am unable to have the Indicator have the option to turn on and off both indicator and Paintbar options so I can have one or the other or both and if the indicator is off, then there should be no panel below.

                  But at least the calculations are now working correctly. If you or anyone is inspired to fix this for me (the 2nd attachment PB) I would be very grateful.
                  Attached Files
                  Last edited by cclsys; 11-05-2008, 11:26 AM.

                  Comment


                    #54
                    Live data problem

                    Bertrand,

                    in monitoring the cross indicator in real-time, I note that the MA changes color inaccurately (when calculate on close is false or true), whereas the paintbars do not. Any idea why that is so?

                    There are 2 examples in the pic of where the paintbar was correct and the MA was incorrect. (My colors are yellow = bullish, cyan = bearish).

                    The last cyan bar on the series on the left stayed cyan as there was no cross, but the MA changed to yellow incorrectly.

                    Later on, (the bar after the trade exit) again the MA changed but the paintbar did not (and the paintbar was correct).
                    Attached Files
                    Last edited by cclsys; 11-05-2008, 10:18 AM.

                    Comment


                      #55
                      NinjaScript itself is just a brand name for libraries we create in the C# language for the purpose of indicator/strategy development. Some of your questions are generic C# programming language questions. Our help guide does provide some basic high level comments on C# programming but this is outside the scope of what we are able to provide support for.

                      - In the NinjaScript section of our Help Guide, you will find resources such as tutorials and descriptions of NinjaScript properties and methods
                      - For C# programming I suggest Googling it as there are many free online resources
                      - We also have resources in this forum as well
                      RayNinjaTrader Customer Service

                      Comment


                        #56
                        Hi cclsys,
                        Thanks for the feedback, I will take a look at this and debug if needed, but it may take some days, as we are pretty busy. Thanks for your patience!

                        Originally posted by cclsys View Post
                        Bertrand,

                        in monitoring the cross indicator in real-time, I note that the MA changes color inaccurately (when calculate on close is false or true), whereas the paintbars do not. Any idea why that is so?

                        There are 2 examples in the pic of where the paintbar was correct and the MA was incorrect. (My colors are yellow = bullish, cyan = bearish).

                        The last cyan bar on the series on the left stayed cyan as there was no cross, but the MA changed to yellow incorrectly.

                        Later on, (the bar after the trade exit) again the MA changed but the paintbar did not (and the paintbar was correct).
                        BertrandNinjaTrader Customer Service

                        Comment


                          #57
                          SampleMultiColorMACrossRd

                          Hi cclsys,

                          Please update your files to this new version of your requested indicator.

                          It includes rounding to make sure the correct display color is used.

                          Also - this study was designed to use it with 'CalculateOnBarClose = True'.

                          Have a good evening!
                          Attached Files
                          BertrandNinjaTrader Customer Service

                          Comment


                            #58
                            thankss

                            Originally posted by NinjaTrader_Bertrand View Post
                            Hi cclsys,

                            Please update your files to this new version of your requested indicator.

                            It includes rounding to make sure the correct display color is used.

                            Also - this study was designed to use it with 'CalculateOnBarClose = True'.

                            Have a good evening!
                            I didn't notice this latest post for some time! I shall try it out. Thank you.

                            Is there an easy way to copy an indicator in a file to another one with a different name so you can experiment with it without losing the original and having to start all over again importing the zip file each time you experiment?

                            Comment


                              #59
                              You could try opening the original file, then right click in the NinjaScript Editor and select "Save As...".
                              RayNinjaTrader Customer Service

                              Comment


                                #60
                                jurik

                                Originally posted by NinjaTrader_Ray View Post
                                You could try opening the original file, then right click in the NinjaScript Editor and select "Save As...".
                                Thanks, so easy when you know!

                                Did that, no problem, took out the rounding formula which was not helpful because it changed the values, then eliminated the neutral one in the code (rising, falling, neutral) which was unnecessary because the up color was if it is >=, compiled, and then there was an error with Jurik indicators which I cannot fix because they don't show up in the script menu and have never even looked at them once, either to plot or edit.

                                So I guess that's that. Can't compile anything, can't fix whatever it is I didn't touch. Is there any way to fix this or do I have to re-install the entire program again?

                                This is an extremely difficult platform for doing the simplest of things!

                                Your indicator in update intrabar mode which is what I need it for gets the wrong color (happens correctly intrabar but then won't change back to right color if changes again within the same bar before it closes) so I am going to keep using the basic EMA without color change capability and just plot dots instead of a line which for some reason makes it easier to see when both are close together.

                                And once again I am staying away from anything to do with Ninja Script! If even simple things like this are so complex, it is not for me. I can tell it's excellent, but I have no interest in learning C+ without help.

                                With that said, it would be nice if you could help me fix the Jurik business so I have a clean platform again.

                                Also, for some reason (again), it asked for my license key when I logged on.

                                Ash.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Segwin, 05-07-2018, 02:15 PM
                                14 responses
                                1,788 views
                                0 likes
                                Last Post aligator  
                                Started by Jimmyk, 01-26-2018, 05:19 AM
                                6 responses
                                837 views
                                0 likes
                                Last Post emuns
                                by emuns
                                 
                                Started by jxs_xrj, 01-12-2020, 09:49 AM
                                6 responses
                                3,293 views
                                1 like
                                Last Post jgualdronc  
                                Started by Touch-Ups, Today, 10:36 AM
                                0 responses
                                12 views
                                0 likes
                                Last Post Touch-Ups  
                                Started by geddyisodin, 04-25-2024, 05:20 AM
                                11 responses
                                62 views
                                0 likes
                                Last Post halgo_boulder  
                                Working...
                                X