NexusFi: Find Your Edge


Home Menu

 





Auto-Maximize Window Based On Signal


Discussion in NinjaTrader

Updated
    1. trending_up 1,187 views
    2. thumb_up 7 thanks given
    3. group 1 followers
    1. forum 6 posts
    2. attach_file 3 attachments




 
Search this Thread

Auto-Maximize Window Based On Signal

  #1 (permalink)
 RosDaBoss 
USA
 
Experience: Intermediate
Platform: NinjaTrader, Tradestation, Win98
Trading: 6E, ES, TF
Posts: 33 since Feb 2011
Thanks Given: 44
Thanks Received: 27

Is there an existing script/feature for NT 7 that allows a signal to maximize a window of an instrument that has an alert/signal? Say for example you have a chart that has an alert signal that plays. That would be the cue to maximize the corresponding window. Heck I'm even willing to use NT8 not sure if NT8 has anything like that/.

This is what I have found so far:
https://forum.ninjatrader.com/showthread.php?p=248169

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
What broker to use for trading palladium futures
Commodities
Quant vue
Trading Reviews and Vendors
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #3 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,426


Use this:

 
Code
using System.Windows.Forms;


	protected override void OnBarUpdate()
        {
		if (CurrentBar == 400)
		{
			ChartControl.FindForm().WindowState = FormWindowState.Maximized;
				
			// might also want to use these
			//ChartControl.FindForm().BringToFront();
			//ChartControl.FindForm().Show();
		}
        }

To test, just create a new chart with 300 bars, add the new indicator, then change the data series to have >400 bars and you will see the signal trigger the window to full size.

I have thought about putting similar into rfkFlipCharts for some time, but that code is easy enough for a simple single chart signal. Said Peter.

[NB** Add 'if (ChartControl != null)' tests if there is any chance of the code being used in a non-chart strategy.]

Cheers

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 RosDaBoss 
USA
 
Experience: Intermediate
Platform: NinjaTrader, Tradestation, Win98
Trading: 6E, ES, TF
Posts: 33 since Feb 2011
Thanks Given: 44
Thanks Received: 27

@ratfink Thanks for your response.

Any idea how i could possibly use it with bloodhound? So I have bloodhound (SiBloodHound) on panel 2 of my chart. The bloodhound plots a long confidence (1) or short confidence (-1) if the conditions are in place. Maybe that code you sent me above I place in panel 2 with bloodhound and monitor for the long/short confidence of 1 or -1 to maximize. It would have to be the indicator only on that chart since I have bloodhound on 20 other charts running.

In your situation you could possibly use bloodhound to create majority of the logic and just have the maximize code look at the 1 or -1 plot. That simplifies the whole situation.

Started this thread Reply With Quote
Thanked by:
  #5 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,426


RosDaBoss View Post
@ratfink Thanks for your response.

Any idea how i could possibly use it with bloodhound? So I have bloodhound (SiBloodHound) on panel 2 of my chart. The bloodhound plots a long confidence (1) or short confidence (-1) if the conditions are in place. Maybe that code you sent me above I place in panel 2 with bloodhound and monitor for the long/short confidence of 1 or -1 to maximize. It would have to be the indicator only on that chart since I have bloodhound on 20 other charts running.

In your situation you could possibly use bloodhound to create majority of the logic and just have the maximize code look at the 1 or -1 plot. That simplifies the whole situation.

I don't know Bloodhound at all, but you could write an indicator that takes any signal input (using the normal Ninja Indicator Input Parameter Dialog selection) and activates the maximise code line, the CurrentBar was just a test example.

Maybe another BloodHound user could chip in here.

Cheers

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,426

@RosDaBoss

Here's a simple example including code and setup, just for testing in this case I've attached it to RSI. I'm assuming you can attach to BloodHound generated indicators in the same way. If not you will need to find out how to plug user code in by a different route.

Default signal values are +1 and -1 for BH (ignore the test values).

You could obviously add loads of other control mechanisms or gates, resets, etcetera.

Cheers

 
Code
using System.Windows.Forms;


namespace NinjaTrader.Indicator
{
    [Description("Enter the description of your new custom indicator here")]
    public class rfkMaxOnSignal : Indicator
    {
        private int longValue = 1;
        private int shortValue = -1;
        private int resetBars = 1;
		
	private int signalBar = -1;
		
		
        protected override void Initialize()
        {
            Overlay	= true;
        }

        protected override void OnBarUpdate()
        {
		if (Historical)
			return;
			
		if (Input[0] >= longValue || Input[0] <= shortValue)
		{
			if (CurrentBar >= signalBar + resetBars)
			{
				signalBar = CurrentBar;
					
				if (ChartControl != null)
				{
					ChartControl.FindForm().WindowState = FormWindowState.Maximized;
				}
			}
		}
        }
}

Travel Well
Attached Files
Elite Membership required to download: rfkMaxOnSignal.zip
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #7 (permalink)
 RosDaBoss 
USA
 
Experience: Intermediate
Platform: NinjaTrader, Tradestation, Win98
Trading: 6E, ES, TF
Posts: 33 since Feb 2011
Thanks Given: 44
Thanks Received: 27

Thanks @ratfink for your support. I just got out of work. I got in contact with Shark Indicators just to verify the plot to select. Waiting for their response.

Attached Thumbnails
Click image for larger version

Name:	2017-08-07 18_41_03-Indicators.png
Views:	149
Size:	9.8 KB
ID:	239664  
Started this thread Reply With Quote
Thanked by:




Last Updated on August 7, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts