NexusFi: Find Your Edge


Home Menu

 





Open ChartTrader with Strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one ThatManFromTexas with 7 posts (9 thanks)
    2. looks_two lolu with 4 posts (2 thanks)
    3. looks_3 askerix with 3 posts (0 thanks)
    4. looks_4 nailz420 with 1 posts (3 thanks)
    1. trending_up 7,383 views
    2. thumb_up 14 thanks given
    3. group 10 followers
    1. forum 18 posts
    2. attach_file 1 attachments




 
Search this Thread

Open ChartTrader with Strategy

  #1 (permalink)
 nailz420 
NYC
 
Experience: Beginner
Platform: NinjaTrader
Posts: 14 since Dec 2009
Thanks Given: 9
Thanks Received: 9

Hi,

I found how to make enable chart trade while running a strategy on the chart. I put this code in the OnBarUpdate method:
 
Code
        ChartControl.ChartTraderEnabled = true;
	ChartControl.Controls["pnlChartTrader"].Enabled = true;
	ChartControl.Controls["pnlChartTrader"].Visible = true;	
	ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"].Enabled = true;
	ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"].Visible = true;
This code opens the chart trader panel and allows you to place orders and shows the current pnl. However it does not enable to context menu order placement options or the on-chart order and avg price markers. Any idea how that can be enabled as well?

Thanks,
Tim

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #3 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,348



nailz420 View Post
Hi,

I found how to make enable chart trade while running a strategy on the chart. I put this code in the OnBarUpdate method:
 
Code
        ChartControl.ChartTraderEnabled = true;
	ChartControl.Controls["pnlChartTrader"].Enabled = true;
	ChartControl.Controls["pnlChartTrader"].Visible = true;	
	ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"].Enabled = true;
	ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"].Visible = true;
This code opens the chart trader panel and allows you to place orders and shows the current pnl. However it does not enable to context menu order placement options or the on-chart order and avg price markers. Any idea how that can be enabled as well?

Thanks,
Tim

Thanks for sharing this info!

I got around the whole thing by running an indicator that passed order variables to a strategy that was called from within the indicator and that also invoked an ATM strategy for handling stops and targets. That way all the Chart Trader, menu order placement and on chart order placement was available. It also allowed me to
drag the stops and targets and still have the ATM manage them. I created new buttons on the Chart Trader to set stop limit orders for range bars.

You might get some help from the guys in these threads....




I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
  #4 (permalink)
 
lolu's Avatar
 lolu 
Lagos, Nigeria
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader, SierraChart
Trading: Euro Currency & Oil
Frequency: Daily
Duration: Hours
Posts: 2,552 since Jun 2009
Thanks Given: 1,049
Thanks Received: 1,678


ThatManFromTexas View Post
Thanks for sharing this info!

I got around the whole thing by running an indicator that passed order variables to a strategy that was called from within the indicator and that also invoked an ATM strategy for handling stops and targets. That way all the Chart Trader, menu order placement and on chart order placement was available. It also allowed me to
drag the stops and targets and still have the ATM manage them. I created new buttons on the Chart Trader to set stop limit orders for range bars.

You might get some help from the guys in these threads....




@ TMFT

Which indicator do you have that will pass order variables to a strategy that is called from within it and which also invokes an ATM strategy for handling stops and targets ? I attempted to use the TradersInsight indicator (one of Gomi's Ladder derivatives) to do Order placement some time ago; I can explore that again.

Lolu

Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,348


lolu View Post
@ TMFT

Which indicator do you have that will pass order variables to a strategy that is called from within it and which also invokes an ATM strategy for handling stops and targets ? I attempted to use the TradersInsight indicator (one of Gomi's Ladder derivatives) to do Order placement some time ago; I can explore that again.

Lolu

@lolu

The only purpose of the indicator is to pass the order info to the strategy.

 
Code
 #region Variables
        private NinjaTrader.Strategy.TMFTGuidedStrategy trader;

 void OnBuy(object sender, System.EventArgs e)
			
        {
			
			trader.EnterPosition(OrderAction.Buy,OrderType.Stop, 1, rangeHi, 0, 0, buyRange);
            
        }

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
Thanked by:
  #6 (permalink)
 
lolu's Avatar
 lolu 
Lagos, Nigeria
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader, SierraChart
Trading: Euro Currency & Oil
Frequency: Daily
Duration: Hours
Posts: 2,552 since Jun 2009
Thanks Given: 1,049
Thanks Received: 1,678


ThatManFromTexas View Post
@lolu

The only purpose of the indicator is to pass the order info to the strategy.

 
Code
 #region Variables
        private NinjaTrader.Strategy.TMFTGuidedStrategy trader;

 void OnBuy(object sender, System.EventArgs e)
			
        {
			
			trader.EnterPosition(OrderAction.Buy,OrderType.Stop, 1, rangeHi, 0, 0, buyRange);
            
        }

@ TMFT,

What about the TMFTGuidedStrategy strategy codes ? Also, could you suggest a name for the indicator, or better still, the complete codes of the indicator.

Lolu

Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,348


lolu View Post
@ TMFT,

What about the TMFTGuidedStrategy strategy codes ? Also, could you suggest a name for the indicator, or better still, the complete codes of the indicator.

Lolu

You have to have a place to receive all the pieces of information that the indicator sent.

 
Code
 public void EnterPosition(OrderAction way, OrderType oType, int quantity, double entry, double target, double stop, Button btnCallback)
        {
            

            switch (way)
            {	
                case OrderAction.Buy:
                    switch (oType)
                    {	
						
                        case OrderType.Stop:
							string[] entryOrder = GetAtmStrategyEntryOrderStatus(orderId);
                            atmStrategyId = GetAtmStrategyUniqueId();
							orderId = GetAtmStrategyUniqueId();
							AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Stop, 0, entry,
							TimeInForce.Day, orderId, atmname, atmStrategyId);
                            break;
You can name the indicator anything you want. The strategy has to be named the same thing that you called it in the indicator.

I am NOT a programmer. I am NOT qualified to write strategies for people. I have written simple indicators because I don't believe they could cause a trader serious problems. However, writing something that can generate actual orders is pressure I don't need. (Did I mention the heart attack....)

@bukkan, @BigMike and others on this site have in depth knowledge in this area. I respectfully ask that you contact someone with more experience than me for strategies .

We all have lofty goals... mine is to stay awake the entire trading day ...

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
Thanked by:
  #8 (permalink)
 
lolu's Avatar
 lolu 
Lagos, Nigeria
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader, SierraChart
Trading: Euro Currency & Oil
Frequency: Daily
Duration: Hours
Posts: 2,552 since Jun 2009
Thanks Given: 1,049
Thanks Received: 1,678


ThatManFromTexas View Post
You have to have a place to receive all the pieces of information that the indicator sent.

 
Code
 public void EnterPosition(OrderAction way, OrderType oType, int quantity, double entry, double target, double stop, Button btnCallback)
        {
            

            switch (way)
            {	
                case OrderAction.Buy:
                    switch (oType)
                    {	
						
                        case OrderType.Stop:
							string[] entryOrder = GetAtmStrategyEntryOrderStatus(orderId);
                            atmStrategyId = GetAtmStrategyUniqueId();
							orderId = GetAtmStrategyUniqueId();
							AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Stop, 0, entry,
							TimeInForce.Day, orderId, atmname, atmStrategyId);
                            break;
You can name the indicator anything you want. The strategy has to be named the same thing that you called it in the indicator.

I am NOT a programmer. I am NOT qualified to write strategies for people. I have written simple indicators because I don't believe they could cause a trader serious problems. However, writing something that can generate actual orders is pressure I don't need. (Did I mention the heart attack....)

@bukkan, @BigMike and others on this site have in depth knowledge in this area. I respectfully ask that you contact someone with more experience than me for strategies .

We all have lofty goals... mine is to stay awake the entire trading day ...

@ TMFT,

No, no, no ... I'm not requesting that you write a Strategy. The fact is that, I don't use Strategy ... I detest Strategy. I just wanted the indicator that you have, that passes order variables to a strategy (such as your RangerATM Strategy) and that is called from within it and which also invokes an ATM strategy for handling stops and targets.; but what you posted is part of the codes for the indicator and which I'm unable to understand.

Lolu

Visit my NexusFi Trade Journal Reply With Quote
  #9 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,348


lolu View Post
@ TMFT,

No, no, no ... I'm not requesting that you write a Strategy. The fact is that, I don't use Strategy ... I detest Strategy. I just wanted the indicator that you have, that passes order variables to a strategy (such as your RangerATM Strategy) and that is called from within it and which also invokes an ATM strategy for handling stops and targets.; but what you posted is part of the codes for the indicator and which I'm unable to understand.

Lolu

The RangerATM Strategy creates buttons in the toolbar and can not be in the same chart as the chart trader. It is a strategy and invokes an ATM strategy to handle the stops and targets. It doesn't connect to an indicator. @bukkan helped me create it and has a in depth understanding of order handling in NT.

The snippet I posted above from an indicator requires a strategy to pass the information to . It is totally different from the Ranger ATM strategy and a lot more complicated (translation: a lot easier to screw things up). You need to get input from someone of Bukkan's ability to advise you on it. I do not have the skill level to justify passing out critical code to traders that could very well blow them up.

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
Thanked by:
  #10 (permalink)
 
lolu's Avatar
 lolu 
Lagos, Nigeria
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader, SierraChart
Trading: Euro Currency & Oil
Frequency: Daily
Duration: Hours
Posts: 2,552 since Jun 2009
Thanks Given: 1,049
Thanks Received: 1,678



ThatManFromTexas View Post
The RangerATM Strategy creates buttons in the toolbar and can not be in the same chart as the chart trader. It is a strategy and invokes an ATM strategy to handle the stops and targets. It doesn't connect to an indicator. @bukkan helped me create it and has a in depth understanding of order handling in NT.

The snippet I posted above from an indicator requires a strategy to pass the information to . It is totally different from the Ranger ATM strategy and a lot more complicated (translation: a lot easier to screw things up). You need to get input from someone of Bukkan's ability to advise you on it. I do not have the skill level to justify passing out critical code to traders that could very well blow them up.

My brain is getting grasp of it now. I quite already understood the function of your RangerATM which I had used in the past. In any case, I'm confident that your codes wouldn't blow me up; I can handle it ... incidentally, I'm a Programmer. Meanwhile, I'll explore Bukkan's inputs.

Lolu

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on March 27, 2013


© 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