Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ChartControl.ParentForm.Show

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

    ChartControl.ParentForm.Show

    Hello

    I've recently discovered this command but couldn't find any information about it in the support section so I'm starting this thread because I'd like to use it in my strategy.

    Here's my question to the wider community:
    When enabling the extremely basic strategy posted below, the chart appears on the screen when the condition is met and disappears when it is not, exactly as expected.

    if(Close[0]>Open[0])

    {
    ChartControl.ParentForm.Show();

    }


    if(Close[0]<=Open[0])

    {
    ChartControl.ParentForm.Hide();

    }

    But, when I integrate the ChartControl.ParentForm.Show() command into my automated strategy, it doesn't work anymore. Any idea why that might be?

    Thanks a lot.

    Here's the code snippet that draws an arrow under the candle that generated the signal, plays an alert but fails to bring the chart on the screen. (My entry criteria clearly aren't the problem as the arrow is drawn and the alert is played).

    if(MyCriteriaHere)

    {
    DrawArrowUp("GreenArrowLong" + CurrentBar, false, 0, Low[0]- 4*(TickSize), Color.Lime);
    PlaySound("Alert1.wav");
    ChartControl.ParentForm.Show();
    }
    Last edited by laocoon; 06-10-2013, 01:41 AM.

    #2
    As I really need the ParentForm.Show command to work, I continued playing with it and came to the following conclusion: The Show command only works in conjunction with the Hide command. When I remove the Hide snippet from the code posted below, it stops working (it works perfectly as long as the Hide command is included):

    if(Close[0]>Open[0])

    {
    ChartControl.ParentForm.Show();

    }


    if(Close[0]<=Open[0])

    {
    ChartControl.ParentForm.Hide();

    }


    This is illogical in my view, as I only need a chart to Show when a trading signal from my strategy is triggered and I can then Hide it manually myself.

    What's even more irritating though is the fact that when I modify the Hide criteria (code below), it doesn't work either.

    if(Close[0]>Open[0])

    {
    ChartControl.ParentForm.Show();

    }


    if (ToTime(Time[0]) == 220000)

    {
    ChartControl.ParentForm.Hide();

    }

    In this example, I want the chart to Hide only at 2200.

    Could someone please enlighten me here?

    Thanks
    Last edited by laocoon; 06-24-2013, 04:59 AM.

    Comment


      #3
      Originally posted by laocoon View Post
      As I really need the ParentForm.Show command to work, I continued playing with it and came to the following conclusion: The Show command only works in conjunction with the Hide command. When I remove the Hide snippet from the code posted below, it stops working (it works perfectly as long as the Hide command is included):

      if(Close[0]>Open[0])

      {
      ChartControl.ParentForm.Show();

      }


      if(Close[0]<=Open[0])

      {
      ChartControl.ParentForm.Hide();

      }


      This is illogical in my view, as I only need a chart to Show when a trading signal from my strategy is triggered and I can then Hide it manually myself.

      What's even more irritating though is the fact that when I modify the Hide criteria (code below), it doesn't work either.

      if(Close[0]>Open[0])

      {
      ChartControl.ParentForm.Show();

      }


      if (ToTime(Time[0]) == 220000)

      {
      ChartControl.ParentForm.Hide();

      }

      In this example, I want the chart to Hide only at 2200.

      Could someone please enlighten me here?

      Thanks
      What timeframe for the chart?
      What is COBC?

      Comment


        #4
        Originally posted by koganam View Post
        What timeframe for the chart?
        What is COBC?
        Koganam,

        The timeframe (for testing purposes) is 1 minute.
        COBC is set to true.

        Thanks

        Comment


          #5
          Originally posted by laocoon View Post
          Koganam,

          The timeframe (for testing purposes) is 1 minute.
          COBC is set to true.

          Thanks
          Hm. That is a bit strange. Are you testing this live or Market Replay?

          Try this, and let us examine the output in the Output Window.
          Code:
          if (ToTime(Time[0]) == 220000)
          
          {
          Print("About to hide the form");
          Print("Bar Time" + Time[0];
          ChartControl.ParentForm.Hide();
          Print("Did we really hide the form?")
          }
          Incidentally, do you have anything in the log about this?

          Comment


            #6
            What makes you believe 220000 is hit exactly? that is borderline unlikely in this game of horseshoes.



            Originally posted by laocoon View Post
            As I really need the ParentForm.Show command to work, I continued playing with it and came to the following conclusion: The Show command only works in conjunction with the Hide command. When I remove the Hide snippet from the code posted below, it stops working (it works perfectly as long as the Hide command is included):

            if(Close[0]>Open[0])

            {
            ChartControl.ParentForm.Show();

            }


            if(Close[0]<=Open[0])

            {
            ChartControl.ParentForm.Hide();

            }


            This is illogical in my view, as I only need a chart to Show when a trading signal from my strategy is triggered and I can then Hide it manually myself.

            What's even more irritating though is the fact that when I modify the Hide criteria (code below), it doesn't work either.

            if(Close[0]>Open[0])

            {
            ChartControl.ParentForm.Show();

            }


            if (ToTime(Time[0]) == 220000)

            {
            ChartControl.ParentForm.Hide();

            }

            In this example, I want the chart to Hide only at 2200.

            Could someone please enlighten me here?

            Thanks

            Comment


              #7
              Originally posted by koganam View Post
              Hm. That is a bit strange. Are you testing this live or Market Replay?

              Try this, and let us examine the output in the Output Window.
              Code:
              if (ToTime(Time[0]) == 220000)
              
              {
              Print("About to hide the form");
              Print("Bar Time" + Time[0];
              ChartControl.ParentForm.Hide();
              Print("Did we really hide the form?")
              }
              Incidentally, do you have anything in the log about this?
              Thanks Koganam. I'm testing live and there's nothing in the log.
              The reason why I chose to use ToTime(Time[0]) == 220000 is only because I was looking for a condition that will never be met (by that time I'm not in the office anymore and my PC is powered down).
              It could be replaced by any other condition that is basically never met. The only rationale for doing this is that I'm using over 100 charts and I don't have enough screen real estate for them. I want a chart to Show when the criteria of my strategy are met and then I can manually Hide it once the signal is no longer valid.

              Thanks


              Originally posted by sledge View Post
              What makes you believe 220000 is hit exactly? that is borderline unlikely in this game of horseshoes.
              It won't be met (and it doesn't even have to) for the reasons I highlighted in the post above. Thanks.

              Comment


                #8
                If someone from Ninja staff is following this thread, please consider the following (dual) request as this is a situation that I'm sure is relevant to many users:

                1. As highlighted in the thread mentioned below, it is very cumbersome if working with many charts (100+ in my case) to have to click on every single title bar when starting Ninja in order to make the chart name visible. I'm spending a good 20 minutes every morning doing this, obviously a pure waste of time.



                2. When running an automated strategy (as in my case), I want to see the chart that generates a trading signal to check how the trade is unfolding. Right now I use the Output Window to check on which market the signal was generated and then I have to browse through all 100+ title bars to look for the relevant chart (I simply do not have enough screen real estate to display so many charts).
                It would be so much easier if the chart just popped up on the screen using the Show command as soon as a trading signal is triggered. This is what I'm trying to accomplish right now (and the reason for starting this thread). I'm sure it would benefit a lot of traders if there was a standard code snippet with the Show command that one could just integrate in any automated trading strategy.

                Thanks
                Last edited by laocoon; 06-27-2013, 02:43 AM.

                Comment


                  #9
                  laocoon, thanks for ringing our bell on this one, I can assure you the feedback in this regard is logged in our product enhancement tracking lists.

                  I've added a vote as well for having strategies open charts / trigger changing of focus when signals are generated - thanks for taking the time to voice those.

                  All the best,
                  BertrandNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by The_Sec, Yesterday, 03:37 PM
                  1 response
                  11 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by vecnopus, Today, 06:15 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post vecnopus  
                  Started by Aviram Y, Today, 05:29 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post Aviram Y  
                  Started by quantismo, 04-17-2024, 05:13 PM
                  3 responses
                  27 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by ScottWalsh, 04-16-2024, 04:29 PM
                  7 responses
                  36 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Working...
                  X