NexusFi: Find Your Edge


Home Menu

 





Click Trader for Chart Traders


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one vantojo with 7 posts (1 thanks)
    2. looks_two terratec with 6 posts (0 thanks)
    3. looks_3 monpere with 4 posts (5 thanks)
    4. looks_4 OpalDragon with 3 posts (0 thanks)
      Best Posters
    1. looks_one sam028 with 3 thanks per post
    2. looks_two monpere with 1.3 thanks per post
    3. looks_3 futuretrader with 1 thanks per post
    4. looks_4 ThatManFromTexas with 1 thanks per post
    1. trending_up 19,012 views
    2. thumb_up 16 thanks given
    3. group 13 followers
    1. forum 29 posts
    2. attach_file 0 attachments




 
Search this Thread

Click Trader for Chart Traders

  #11 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012

muchissimas gracias

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Quantum physics & Trading dynamics
The Elite Circle
Better Renko Gaps
The Elite Circle
 
  #12 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,372


futuretrader View Post
All this stuff is unsupported.

You need to get the ChartTrader controls, and then you can get the name of the currently selected atmstrategy.

string atm = ctrader.Controls["cboStrategy"].Text;

If chart trader is not visible though, I believe this will return an error. Any one knows how to programmatically show and hide chart trader?

Reply With Quote
  #13 (permalink)
 terratec 
Zurich Switzerland
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515



futuretrader View Post
string atm = ctrader.Controls["cboStrategy"].Text;

Any idea how to solve that known problem with the .Controls?

Error on calling 'xxxxxxx' method for indicator 'yyyyyyyy: Object reference not set to an instance of an object.

Reply With Quote
  #14 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


terratec View Post
Any idea how to solve that known problem with the .Controls?

Error on calling 'xxxxxxx' method for indicator 'yyyyyyyy: Object reference not set to an instance of an object.

Maybe:
 
Code
                            
if (ctrader.Controls["cboStrategy"] != null) {

  
string atm ctrader.Controls["cboStrategy"].Text;}
else {
  Print(
"Houston, we have a problem...");
  } 

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #15 (permalink)
 terratec 
Zurich Switzerland
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515


sam028 View Post
Maybe:
 
Code
                            
if (ctrader.Controls["cboStrategy"] != null) {

  
string atm ctrader.Controls["cboStrategy"].Text;}
else {
  Print(
"Houston, we have a problem...");
  } 

I am using a code like this for the charttrader infos and it does fine as long as charttrader is enabled.
To be more specific: How to solve the above problem that occurs when charttrader is not enabled?

Reply With Quote
  #16 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,372


terratec View Post
I am using a code like this for the charttrader infos and it does fine as long as charttrader is enabled.
To be more specific: How to solve the above problem that occurs when charttrader is not enabled?

Look at post #12. If chart trader is not visible, the objects do not exist, so you will get errors trying to access them. I use

if ( ChartControl.ChartTraderEnabled && ChartControl.ChartTraderVisible ) {
Blah...Blah
}

Reply With Quote
Thanked by:
  #17 (permalink)
 terratec 
Zurich Switzerland
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515


monpere View Post
Look at post #12. If chart trader is not visible, the objects do not exist, so you will get errors trying to access them.

I have this error only at startup, change of timeframe etc. when CT is disabled.
But after starting with CT enabled, I can disable the CT and the CT items do exist. The same way as they exist when CT is disabled and you place an order with the right mouse on the chart, then the ATM Strategy and Quantity from CT is used.

Looks like I have to survive the OnStartup, and everything will be fine.

Thanks for code. This could solve the problem. Will test it.

Reply With Quote
  #18 (permalink)
 terratec 
Zurich Switzerland
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515


terratec View Post
Thanks for code. This could solve the problem. Will test it.

I did a quick test with this code:
 
Code
if ( ChartControl.ChartTraderEnabled && ChartControl.ChartTraderVisible )
It did work without errors. At startup CT must be enabled, or use F5 after that.
Change timeframe, instrument with CT disabled works fine.
To change Account, Strategy, Quantity, the CT has to be enabled (that’s clear, as you want that stuff)

To make it perfect, a code to make CT enabled at startup would be the final point.
That’s just a first test, but IMO the results are promising.

Reply With Quote
  #19 (permalink)
 terratec 
Zurich Switzerland
 
Experience: Intermediate
Platform: NinjaTrader
Broker: IB
Trading: ES, 6E, CL
Posts: 403 since Sep 2009
Thanks Given: 64
Thanks Received: 515

I could not edit my last post to add a comment…. So I have to add a new one.

As the code is not a secret sauce you cannot expect a miracle. It is nice to take the “unsupported code” out of the game in situations where it would produce errors. That’s nice and very useful.
But you have to think more serious about whether charttrader info’s are up-to-date in your variables at a specific moment or not.

To have the code to show charttrader would be helpful. You can access the ShowCharttrader via coding the NT-HotKey. But NT named this HotKey wrong as it is not show-, but enablecharttrader.

Sometimes this “unsupported stuff” goes a baby step forward. That’s always great…

Reply With Quote
  #20 (permalink)
 vantojo 
Vilcabamba, Ecuador
 
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012


I haven't had a chance to look yet...but perhaps the object names are inside the Ninja generated code?


Is there any way to expose all the object names and methods of Chart Trader?

Started this thread Reply With Quote




Last Updated on October 11, 2020


© 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