Been at it for hours...Definitely something simple!!! AHHHHH - NinjaTrader Programming | futures io social day trading
futures io futures trading


Been at it for hours...Definitely something simple!!! AHHHHH
Updated: Views / Replies:1,561 / 23
Created: by Tanju23 Attachments:4

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 4  
 
Thread Tools Search this Thread
 

Been at it for hours...Definitely something simple!!! AHHHHH

  #11 (permalink)
Elite Member
Riverview Fl
 
Futures Experience: Intermediate
Platform: Ninja Trader
Broker/Data: Mirus Futures
Favorite Futures: ES, TF
 
Tanju23's Avatar
 
Posts: 37 since Dec 2009
Thanks: 24 given, 4 received

Its coloring when it is supposed to but it seems only when the conditions are met. Is there a way to "latch" it to stay until the opposite is met?


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
 
  #12 (permalink)
Elite Member
Riverview Fl
 
Futures Experience: Intermediate
Platform: Ninja Trader
Broker/Data: Mirus Futures
Favorite Futures: ES, TF
 
Tanju23's Avatar
 
Posts: 37 since Dec 2009
Thanks: 24 given, 4 received

Here is another example. In the pic It shows a magenta and should change to cyan when the highs break the swing

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
 
  #13 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received


You need to add one more color variable eg.:

 
Code
private Color useThisColor = Color.White;  //just setting up some default
then OnBarUpdate:

 
Code
if (conditionsUpAreMet)
{
    useThisColor = sMAUp;
}
if (conditionsDownAreMet)
{
    useThisColor = sMADn;
}

// and at the bottom:
PlotColors[0][0] = useThisColor;

Reply With Quote
 
  #14 (permalink)
Elite Member
Riverview Fl
 
Futures Experience: Intermediate
Platform: Ninja Trader
Broker/Data: Mirus Futures
Favorite Futures: ES, TF
 
Tanju23's Avatar
 
Posts: 37 since Dec 2009
Thanks: 24 given, 4 received

A BIG THANK YOU!!!!

Just wanted to give you an update. Your guidance paid off and its doing what it is supposed to do!! Thank you again!


Reply With Quote
 
  #15 (permalink)
Elite Member
Riverview Fl
 
Futures Experience: Intermediate
Platform: Ninja Trader
Broker/Data: Mirus Futures
Favorite Futures: ES, TF
 
Tanju23's Avatar
 
Posts: 37 since Dec 2009
Thanks: 24 given, 4 received

Ok Im Back with another question

You helped me get the indicator working great, been using it for a few weeks now with success. Now I'm attempting an automated entry.


Here is my generic code for the purpose of illustration.
 
Code
// Condition set 1
            if (MyTML(Weighted, MB, TMl, 5, 8).TMLUp[1] < MyTML(Weighted, MB, TMl, 5, 8).TMLUp[0]
                && MyMACDBBLines(10, 12, 26, 1).BBMACD[0] > MyMACDBBLines(10, 12, 26, 1).Upper[0])
                
            {
                EnterLong(Contracts, "");
            }


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).




For some reason even though I am saying only "Up", as you can see it is entering on the "Down" indication as well. Any insight would be appreciated. Also, I have to use the indicator on COBC true because it doesn't work quite right with it on false. Probably a separate issue but just throwing all my delimas out there. Thank you to anyone in advanced.

Reply With Quote
 
  #16 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received


Tanju23 View Post
For some reason even though I am saying only "Up", as you can see it is entering on the "Down" indication as well. Any insight would be appreciated. Also, I have to use the indicator on COBC true because it doesn't work quite right with it on false. Probably a separate issue but just throwing all my delimas out there. Thank you to anyone in advanced.

Welcome back

The reason because COBC false doesn't work quite well for you is probably because the values of the indicators change intrabar (ie: during a bar creation you can have: Up, Down, Up, Down, etc.).

As to your main problem in your condition you compare TMLUp[1] and TMLUp[0], but what are the values of TMLUp - Is it possible that the line will be colored down even though [0] is greater than [1]?

I would recommend adding some Print statements eg.
 
Code
Print("TMLUp[1]: "+MyTML(Weighted, MB, TMl, 5, 8).TMLUp[1]);
for all the values so you could check if the condition is what you expect.

Reply With Quote
The following user says Thank You to gregid for this post:
 
  #17 (permalink)
Elite Member
Riverview Fl
 
Futures Experience: Intermediate
Platform: Ninja Trader
Broker/Data: Mirus Futures
Favorite Futures: ES, TF
 
Tanju23's Avatar
 
Posts: 37 since Dec 2009
Thanks: 24 given, 4 received

What are the print statements for?

Would posting the code for the indicator you helped me create help you see an issue?

Reply With Quote
 
  #18 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received

Print will print the message you want into the output window. You can open Output Window from Control Center (Tools) or from NinjaScript code editor (4th icon from the left on the toolbar)

Reply With Quote
The following user says Thank You to gregid for this post:
 
  #19 (permalink)
Elite Member
Riverview Fl
 
Futures Experience: Intermediate
Platform: Ninja Trader
Broker/Data: Mirus Futures
Favorite Futures: ES, TF
 
Tanju23's Avatar
 
Posts: 37 since Dec 2009
Thanks: 24 given, 4 received

yeah it looks like up is being recognized for the whole indicator, how do i get it to just be set with the plots up and down?


here is the indicator. What can you see that I could change...if anything.



 
Code
protected override void Initialize()
        {
            Add(new Plot(new Pen(Color.Cyan,2), "TMLUp"));
          	Add(new Plot(new Pen(Color.Magenta,2), "TMLDn"));
            Overlay				= true;
			PriceTypeSupported	= false;
			PlotsConfigurable   = true;
			CalculateOnBarClose = false;
			
        }
		
		protected override void OnStartUp()
		
		{
			Plots[0].PlotStyle = plot0Style;
			Plots[0].Pen.DashStyle = dash0Style;
			Plots[1].PlotStyle = plot1Style;
			Plots[1].Pen.DashStyle = dash1Style;
		}

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            
			// Are there enough bars
			if (CurrentBar < Period) return;
			
						
			// Calculations
			TMLUp.Set(LinReg(Input,period)[0]);
            TMLDn.Set(LinReg(Input,period)[0]);
			{
				// If high breaks a swing high
				if (High[0] > Swing(swings).SwingHigh[0] || Low[0] >= EMA(Keltner)[0] + Spread * TickSize)
				{
					useThisColor = tMLUp;
				}
			}
			
			{
				// If low breaks a swing low
				if (Low[0] < Swing(swings).SwingLow[0] || High[0] < EMA(keltner)[0] - spread * TickSize)
				{
					useThisColor = tMLDn;
				}
				
				
				PlotColors[0][0] = useThisColor;

Reply With Quote
 
  #20 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received


Your TMLUp and TMLDown seem to be nothing else than just a reference to the same LinReg. If your goal for TMLUp and TMLDown is to only represent binary result (it is either Up or Down, 1 or -1) then you need one additional dataseries TML and temp int, eg.: private int tempTML = 0;
Then in your code just as you did with color:

 
Code
// Calculations
TMLUp.Set(LinReg(Input,period)[0]);
TMLDn.Set(LinReg(Input,period)[0]);

// If high breaks a swing high
if (High[0] > Swing(swings).SwingHigh[0] || Low[0] >= EMA(Keltner)[0] + Spread * TickSize)
{
    useThisColor = tMLUp;
    tempTML = 1;
}

// If low breaks a swing low
if (Low[0] < Swing(swings).SwingLow[0] || High[0] < EMA(keltner)[0] - spread * TickSize)
{
    useThisColor = tMLDn;
    tempTML = -1;
}

TML.Set(tempTML);
In your strategy you can then ask for:
 
Code
if((YourIndicator.TML[0] == 1) 
{
    EnterLong();
}
if(YourIndicator.TML[0] == -1) 
{
    EnterShort();
}
As already mentioned before remove the {} that are not following a method, condition or property details - this is really bad habit and makes the code unreadable - there is no benefit and high cost to using them.


Last edited by gregid; April 14th, 2015 at 08:11 AM.
Reply With Quote
The following user says Thank You to gregid for this post:

Reply



futures io > > > > > Been at it for hours...Definitely something simple!!! AHHHHH

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ahhhhh the wisdom of the ages. kbit Jokes 0 April 1st, 2014 09:08 PM
Trading After Hours ligfing The Elite Circle 4 November 2nd, 2012 04:03 PM
After-hours Trading benharrell Traders Hideout 12 August 20th, 2010 11:24 AM
A few points in first one to 1.5 hours? Nimble The Elite Circle 4 July 28th, 2010 08:58 PM
Market Hours LukeGeniol Help, Tutorials, and How-Tos 0 July 8th, 2010 08:09 PM


All times are GMT -4. The time now is 05:25 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-16 in 0.12 seconds with 20 queries on phoenix via your IP 54.160.245.121