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

Double arrow @ CrossAbv/Blw problem

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

    #16
    Finn, if I may, I hope you do not mind if I post/attach here or email you my code for your review? I have to run now but the first chance I get I will post/attach that part of my code...
    Thank you, Art.

    Comment


      #17
      Not at all. Hope I can help you.
      Finn

      Comment


        #18
        Hi Finn,
        Here's the example...

        if CrossBelow(Stochastics(PeriodD, PeriodK, Smooth), 80, 1) // any period...
        {
        if (anyMA < 0) // Draw arrows only if some MA direction is down
        {
        hh = MAX(High, 5)[0]; // get highest bar high
        DrawArrowDown("DnArrow" + CurrentBar, true, 1, (hh+0.0008), Color.Red);

        //prints lines for each bar, e.g. bunch of lines per arrow.
        Print("Below 5 min hh = "+hh + " CurrentBar " + CurrentBar);
        }
        else
        {
        RemoveDrawObject("DnArrow" + CurrentBar);
        }
        }

        The RemoveDrawObject() in else removes all the down arrows from the chart-no arrows on the chart at all.
        Another issue I have is with Print() that partially works and in diff. thread. Although I'm using ...+ CurrentBar it prints lines for each bar, e.g. bunch of output lines per single arrow. Expected one cross/arrow - onle line of output. Please see attached - ready to use Stoch indicator with arrows and print()... The RemoveDrawObject() can be added for testing...
        Thank you very much.
        Regards, Art.
        Attached Files
        Last edited by Art09; 11-16-2010, 08:44 PM.

        Comment


          #19
          Art09
          Try this. I made some comments in the script.

          It is a couple of things I dont understand. You are plotting the StochK, but use the StochD for your crosses, is this correct? You also have fifferent values for the OB / OS colors for the Stoch plot and the cross values. Is this correct?

          btw, to avoid printing many lines in the output window, you will need to use if (FirstTickOfBar) statement.

          Finn
          Attached Files
          Last edited by finnbjurvoll; 11-17-2010, 04:13 AM.

          Comment


            #20
            Thank you very much! I will try and get back to you. I tried using %K only for crosses but it did not work. Could not understand why...
            Art.

            Comment


              #21
              OK, I tried - all arrows removed from the chart - no arrows at all.
              Thank you.
              Art

              Comment


                #22
                What NT ver. do you run Art?
                Attached Files

                Comment


                  #23
                  I'm running 6.5-18

                  Comment


                    #24
                    This should work in that ver. Let me try to do one more change

                    Comment


                      #25
                      Ok Art, try this
                      Attached Files

                      Comment


                        #26
                        Hi Finn and thank you again.
                        There must be smth in my orig program that does not work and causes arrow to disappear. I tried both scripts on diff. chart and it seemed worked fine-all the arrows are in place and I guess it will remove dbl arrows if any. I guess I will have to clean up my orig program and add your changes...
                        I thank you very much for your help. Please keep in touch - [email protected].
                        In the future is there a way to reach you (on some forum maybe) and ask for help?
                        For example, I noticed another problem and I do not know at this point if there is smth in my program or Ninja problem... Here's the problem - I looked at the chart yesterday and there was no cross, e.g. no arrow at some exact poitn of time I looked at. The Stoch was belw 80 and CrossBlw(....80...) would not work-below 75 would work, I tried. I looked at the same spot today and see my arrow and Stoch is abv 80 and crossing dn. I do not know if this is scaling problem or smth else. I see the same things happen every day - no signals in real time or stronger/weaker signals (I'm using AMP-Sim and in my orig program I color code the arrows for stronger/weaker signals). But I see crosses and arrows and/or stronger signals become weaker and the opposite after the session ends... I'm using 300 volume 6E chart for this. What do you think?
                        Thank you very much.
                        Regards, Art.
                        Last edited by Art09; 11-17-2010, 11:36 AM.

                        Comment


                          #27
                          Art, I sent you an email.

                          Finn

                          Comment


                            #28
                            Hi,
                            Struggling with dbl arrows when using cross abv/blw. Someone suggested using K[1] as follows:

                            if (K[0] <= 75 && K[0] >= 65)
                            {
                            if (CrossBelow(Stochastics(3, 10, 2).K, 75, 1))
                            Red arrow...
                            }
                            else if (K[0] <= 60 && K[0] >= 50)
                            {
                            if (CrossBelow(Stochastics(3, 10, 2).K, 60, 1) && (K[1] < 60 || K[1] > 70))
                            Orange arrow...
                            }
                            .....
                            But it still does not work and draws double arrows or no arrows at all where there used to be one.
                            My testing case is Euro 300 volume chart-Jan-06-11 @13:10. There is lower high on price and cross below 80-75 does not work.
                            The cross below 60 works, but only if I remove ... && (K[1] < 60 || K[1] > 70)) from the code. Otherwise no arrow displayed at all. But if I remove that line then double arrows for both crosses 75 and 60 will be displayed and same in many other places too.
                            Please help if you can.

                            Finn, if you are reading this maybe you'd be so kind to help too.
                            Thank you very much,
                            Regards, Art.
                            Last edited by Art09; 01-07-2011, 09:27 AM.

                            Comment


                              #29
                              Art,

                              Focus on the arrow you feel is drawn incorrectly, and look at the conditions for drawing it. Print all the values of anything used in these conditions.

                              Check log tab of control center for any error messages.

                              We have worked with you a good bit on different possibilities and offered several different approaches for debugging this. If it's beyond your current coding skill to work through this problem, then a NinjaScript consultant can help write code to your specifications.
                              Ryan M.NinjaTrader Customer Service

                              Comment


                                #30
                                Hi,
                                Sorry, I need more help and sure that consultants will not be able to explain the cross abv/blw behavior.
                                I attached the screen shot and orig .cs file. The problem is I cannot understand and figure out why I see the Stoch. %K is way above 80% line and seems crossing below it but there is no arrow on the chart.
                                Please see attached. There are few cross below examples highlighted. I understand that using lower values for cross below lk ... if CrossBelow( ... 60, 1) may work and it does work for the third highlighted example but not for the first one...
                                In all highlighted cases the Stoch.%K rises above 89-94 and then clearly crossing below 80 or 75 at least. But there are no arrows on the chart. Why please? Changing BarsAgo value would cause multiple arrows per cross.
                                I hope we agree I cannot ask consultants about this and hope for reasonable explanations and possible solution. The rest I can figure out myself or use consultants as you've suggested many times.
                                My other point here is that it is probably impossible even for skilled consultants to sit and figure out every cross when what one sees is not what one gets - the %K is clearly above 80% and falling below it crossing the line visually but the cross below 80-75 does not work but cross below 60-50-40 may work... I simply not sure that some consultants will be able to fix it... Sorry.
                                Regards, Art.
                                Attached Files
                                Last edited by Art09; 01-09-2011, 09:46 PM.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by sofortune, Yesterday, 10:55 PM
                                3 responses
                                13 views
                                0 likes
                                Last Post NinjaTrader_Gaby  
                                Started by Bobin, 03-12-2024, 08:51 AM
                                18 responses
                                549 views
                                0 likes
                                Last Post TaoTrader  
                                Started by sofortune, Yesterday, 09:49 PM
                                2 responses
                                10 views
                                0 likes
                                Last Post sofortune  
                                Started by EnveousColnago, 03-24-2020, 07:50 AM
                                8 responses
                                367 views
                                0 likes
                                Last Post morozg05  
                                Started by anton_tymoshchuk, Today, 01:14 AM
                                3 responses
                                18 views
                                0 likes
                                Last Post NinjaTrader_Gaby  
                                Working...
                                X