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

Problems learning to change line plot color & draw arrows once only

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

    #31
    Originally posted by NinjaTrader_Josh View Post
    Please see this article: http://www.ninjatrader-support.com/H...taSeriesObject

    Store in 1 or 2 or 3 whenever you change the background color. Then check the DataSeries for whichever value you want.
    Thanks, Josh. I will look at this more. At first glance, though, I don't understand why an instruction as to how to determine a color should be in a data series. Are you saying that I need to put in a number when a condition is met and then somewhere say:

    if Condition X then Series = 1 ;
    If COndition Y then Series = 2;
    If Series = 1 then Backcolor = etc.
    If Series = 2 then Backcolor = etc 2

    But if so, why not just use a true-false boolean as I have done?
    And how does that effect the opacity issue?

    I find it very hard to learn anything without examples and/or simply taking what is being worked on and showing how it could be written. Also, without examples it is possible that I am totally not getting what you are saying (most probable).

    But I gather you guys are not allowed to do give direct solutions in specific coding situations provided. Took me a while, but I finally got it!
    Last edited by cclsys; 03-20-2009, 03:05 PM.

    Comment


      #32
      No. When you set your back color to a certain color also set the DataSeries to take on a numeric value corresponding to that color. Then go back and check the DataSeries to know which color the background is.
      Josh P.NinjaTrader Customer Service

      Comment


        #33
        Here is the patched version, cclsys. Search for my comments with:
        // Ralph:

        Regards
        Ralph
        Attached Files

        Comment


          #34
          Thanks!

          Originally posted by Ralph View Post
          Here is the patched version, cclsys. Search for my comments with:
          // Ralph:

          Regards
          Ralph
          Thanks so much Ralph. There is NO WAY I could have figured that out at my level of experience with the coding.

          All that business in the Properties is still over my ability to learn much from it but I did get something from how you moved the procedures around from the variables menu to the onbar update section and it has helped me understand better how Ninja is structuring things. I have a very hard time understanding things from the manuals etc. and since I have no formal programming experience it is a tad difficult. But when I see how it is done, especially when working on something specifically, then I begin to understand what is going on.

          By the way, even though this is largely about learning to code, if you do use indicators at all, these Ichis are quite good. They took a long time for some Japanese chap to develop before the age of computers but they are designed to give the user and instant way to compare past, probable future, breakouts, consolidations, current likely SR levels etc. I didn't realise untiil I had coded the arrows in and adjusted the code yesterday or this morning that a high percentage of them gave excellent signals with only a few points heat. But the system as designed throws off more than 5 different signal setups - all trend trades - and it can easily be used for consolidation and counter-trend setups as well. Very simple, all based on Donchian channels essentially, but also quite intelligent. In the Simulator yesterday using them (mainly) I had 14 winners out of 15 trades plus one breakeven trade that was an ATM BE stop whilst I was messing around with the plumbing away from the computer during which time there was a good profit in the trade which I was just not there to capitalise on. Not bad. Especially since normally I don't like using indicators. But since I can't (yet) program in systems, I have been having fun using indicators for the first time in years. They are helpful for discretionary trading even if not so helpful for system development. imho.

          Again, thank you VERY MUCH. I like the chart I can now have with this indicator which has quickly become my main one.


          NOW: if you'd like to have a crack at getting the Better Volume Indicator to read up and down volume properly - which the Ninja versions don't yet do - I can send you the text code. Barry Taylor gives it away for free but it's in Tradestation format. It is an excellent non-correlated addition to any chart helping to point out consolidation, reversal, momentum etc. just from the volume alone, no reference to price. The current Ninja version doesn't see up and down volume, only volume. I worked with Barry to get this capability in his latest release (before I switched from TS to Ninja) and it really provides some excellent 'internal' information that you don't get from oscillators and averages etc. alone.

          Again, thanks!

          PS I attach a picture from yesterday showing how good it can be. The special feature is the Clouds (a separately compiled indicator which is displaced 27 bars to the right - or whatever you input for the medium length in the main indicator you have helped perfect).

          Note how in this picture how closely the cloud formation 'predicted' the leg down, including many of the little pullbacks. Again, all drawn 27 bars before the action actually occurred.

          PPS Well, it's way too late, I tried twice but my pic is 120k and that is too big for them here. So I'll try to figure that one out later.
          Last edited by cclsys; 03-20-2009, 10:37 PM.

          Comment


            #35
            Hi cclsys,

            thanks a lot for the informations and your kind words.

            Ninja's VolumeProfile indicator displays up/down volume in the shape of a vertical profile. It compares the actual price with the related ask/bid price and adds to the up/down volume accordingly. It is working for live data only.

            If you have further questions to the modifications made to your code, just ask, and I'll give you a detailed answer.

            Regards
            Ralph

            Comment


              #36
              Originally posted by Ralph View Post
              Hi cclsys,

              thanks a lot for the informations and your kind words.

              Ninja's VolumeProfile indicator displays up/down volume in the shape of a vertical profile. It compares the actual price with the related ask/bid price and adds to the up/down volume accordingly. It is working for live data only.

              If you have further questions to the modifications made to your code, just ask, and I'll give you a detailed answer.

              Regards
              Ralph
              Ralph,

              I can't see in the code where it works with the bid ask volume. But I did get help from someone the first week I had Ninja because I used to use an indicator like that in TS based on bid/offer. There are some dead lines in this code (some things tried that didn't work and aren't active now) but you can see parts where the bid-offer is included. Right now it is both an indicator in a panel below the chart and a paintbar and I didn't put everything in the menus properly so you can choose one or the other or both.

              I find it helpful when you have an up bar with internal down volume or vice versa, especially around potential turning points at SR levels.

              But Barry Taylor's Better Volume is much more sophisticated. Most of the features are already in the current Ninja version but the parts that discriminate between up volume and down volume are not, meaning that
              a) the current configuration is more helpful with up markets and
              b) the differences that can indicate potential upside or downside reversal/momentum simply aren't in the code right now, only various relative fluctuations in basic volume (i.e. higher than average, lower than average, high volume in narrow range, low volume in wide range (stop hunts!), but nothing working with up versus down volume unfortunately which is very helpful.)

              I attach my simple one that does discriminate between internal buy-versus-sell volume intrabar.

              Also attach latest version with a couple of minor additions. Just in case you are interested. Draws a diamond with the close breaks over or under price from MediumPeriod ago, also draws a line back to level MediumPeriod ago when that happens (mainly for checking the code was right since the line is sometimes hard to see - the purple square line that is many bars back of current price on chart). Also an alarm when confirmed up or down signal which we already had along with the infamous arrow that started all this!
              Attached Files
              Last edited by cclsys; 03-24-2009, 09:33 PM.

              Comment


                #37
                photo II

                I added a couple of things but this is my third and final attempt to send pic to show what you helped with. If I can't get it to go through, that's that. No big deal.
                Attached Files

                Comment


                  #38
                  Originally posted by cclsys View Post

                  Also attach latest version with a couple of minor additions. Just in case you are interested. Draws a diamond with the close breaks over or under price from MediumPeriod ago, also draws a line back to level MediumPeriod ago when that happens (mainly for checking the code was right since the line is sometimes hard to see - the purple square line that is many bars back of current price on chart). Also an alarm when confirmed up or down signal which we already had along with the infamous arrow that started all this!
                  cclsys,

                  Is that second zip file you posted the template you've been working on? Your ideas sound so good. You mention a particular time frame you found to be most useful. Could you please mention what time frame that is?

                  Also, I saw that you mention a programmer that worked on some indicators for you. Is that the programmer that NT refers one to in order to make templates or strategies? You pay for it and can't see the code? hmmm...

                  Sharon

                  Comment


                    #39
                    Originally posted by SharonSS View Post
                    cclsys,

                    Is that second zip file you posted the template you've been working on? Your ideas sound so good. You mention a particular time frame you found to be most useful. Could you please mention what time frame that is?

                    Also, I saw that you mention a programmer that worked on some indicators for you. Is that the programmer that NT refers one to in order to make templates or strategies? You pay for it and can't see the code? hmmm...

                    Sharon
                    Sharon, thanks for kind words!

                    1. My background is mainly in portfolio system development using long term timeframes, nowadays Weekly. (see www.ccl-trading-systems.com). Such systems tend to be very simple algorithm-wise but more subtle (hopefully) in terms of initial strategic vision.
                    2. Yes, that last file was the latest version of the Ichimoku that I got from Goldfly in the shared indicator section. His package also has the clouds, to which I added a little triangle that shows on the current bar on the screen when a cross happens (usually out of vision to the right). If you want me to upload that Cloud version just ask and I shall do so.
                    3. I recently decided to get into day-trading to supplement income to which end I purchased a method that came with black box software and when I found my Tradestation account cancelled due to my living in a certain province in Canada, migrated (reluctantly) over to Ninja since that method was going to be available in Ninja as well and I was not confident that I could a) program my own methods in Ninja script or b) find anything better. So right now I have that indicator (source code protected). I believe there are many such on the market. I only bought it as part of studying a day-trading approach that seemed successful because the outlook and methodology with day trading is a bit different from long term trading.

                    As to your question re timeframes, I am mainly researching one market (30 year bonds) and I have a simple approach of having one very short-term tick chart often used to fine-tune trade entry, then one base tick chart (90 ticks) and one 3* higher (270 ticks).

                    In order to test the Ichi approach I managed to turn the indicator in this thread into a simple crossover system with stops and profit targets, the intention being not to trade it automatically, but to quickly test for good crossover parameters and then use those for discretionary day trading. In other words, I run the strategy over the past 2-3 weeks of 90 tick data to get decent crossover parameters, then apply those to my daytrading charts in Ninja.

                    All I have tried to do with this Ichi indicator is to have little alerts showing the various Ichimoku conditions which reference the future projections in the cloud formations and also compare with the past in the Kichou line. The clouds are usually off the chart 27+ bars to the right and the Kichou is often hard to see when reviewing the charts after the event since you can't tell which bar was being drawn at the bar you are now looking at. During live trading you can easily see the last plotted Kichou line. (I also wanted to see if I could put in these diamonds and arrows and alarms just to learn NInja coding better.)

                    I must say that the Ichi indicators are very good. I don't think it is all that important to optimize the crossovers and probably one is fine with something like 9, 26 and 52 which are the official levels. Now these were based on the Japanese trading month (26 days per month) using Daily charts so personally I prefer to start off with the first value, say 9, and then multiply that by 3 and then double the last one. Simple. But the way they work to show support-resistance, trend and consolidation is excellent so I find them excellent for determining when to take trend following and when to take pullback/retracement and when to do counter-trend or trading range trades. The more I work with them the less I feel the need for any other indicator.

                    And as with all indicators, it helps to have more than one timeframe. For example if the 90 signals a buy in a 270 bear market, the 270 does a good job of giving a better idea of potential resistance for the current 90 up-move should it prove a strong one, or might even show that this is really a bad place to bet on the 90 having any traction.

                    Anyway, I think if you have them up for a while on any chart or timeframe and have one 3* more than the other, you will see that they are a very helpful approach to 'reading' current market situation.

                    Enjoy!

                    PS. The more I work with Ninja, even though it is hard for someone without formal programming background, the more I am coming to respect and appreciate it. Feels like a Mercedes compared to Tradestation's more user-friendly Honda. Also harder to tinker with programming-wise, but when you get something working it feels very solid and accurate, along with having a pleasing graphical feel more akin to a Macintosh than a PC. So even though there are still many things I cannot do and ideas I cannot even begin to program or test, I am now happy that circumstances beyond my control forced me to make the switch.
                    Last edited by cclsys; 03-28-2009, 05:14 PM.

                    Comment


                      #40
                      Hi cclsys,

                      Thank you for you indepth response, cclsys. I read it last night and figured I needed to learn more about the Ichimoku System - and learn I did.

                      I did a Yahoo search and found these:

                      Ichimoku Forum

                      http://www.kumotrader.com/forum/index.php

                      http://www.kumotrader.com/ichimoku_wiki/index.php?title=Main_Page

                      I'm trading only the EUR/USD and using the 5M, 15M, 30M, and 60M on NT, but in addition in my Ensign Software I have the 240M, D,W,M.

                      Here's where I'm at presently: I don't have any bars on my NT charts as the program froze Friday (my fault) so I deleted and re-installed. My broker is MB Trading who doesn't offer historic data so bars will be starting over when market opens today. This means I won't be applying your template until bars have built up.

                      I had considered getting BarCharts for historic data, but in reading about the Ichi System I realized I needed the past 52 days of data for the lagging Senkou Span. This is easily done in my Ensign Software, but more of a problem in NT because it appears NT becomes troublesome with a lot of data on charts.

                      Good news here is that someone in Ensign had made a Ichi System template so have it applied on my charts there.

                      I opened a NT 1M chart - maybe enough bars will grow fast to make your template valid.

                      Sharon

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by cre8able, Today, 01:16 PM
                      2 responses
                      9 views
                      0 likes
                      Last Post cre8able  
                      Started by chbruno, 04-24-2024, 04:10 PM
                      3 responses
                      48 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by samish18, Today, 01:01 PM
                      1 response
                      7 views
                      0 likes
                      Last Post NinjaTrader_LuisH  
                      Started by WHICKED, Today, 12:56 PM
                      1 response
                      9 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by WHICKED, Today, 12:45 PM
                      1 response
                      11 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Working...
                      X