Open ChartTrader with Strategy - NinjaTrader Programming | futures io social day trading
futures io futures trading


Open ChartTrader with Strategy
Updated: Views / Replies:4,461 / 18
Created: by nailz420 Attachments:1

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
 1  
 
Thread Tools Search this Thread
 

Open ChartTrader with Strategy

  #11 (permalink)
Elite Member
Zurich, Switzerland
 
Futures Experience: None
Platform: NT
Favorite Futures: Ukulele
 
Posts: 16 since Mar 2011
Thanks: 342 given, 14 received

TMFT,

great idea to create a strategyobject within the indicator. I've worked around that charttrader/strategy-issue before with a separate window for my strategy buttons - but that opens a lot new possibilities.

I tried to test it with a dummy strategy but failed with the integration into the indicator.
It would be great if you can share a code sample which
  • creates the object (skip that - you've done already)
  • defines the used account (do you have to set the enable property of the strategy object to false while adjusting the Account?)
  • other preparations necessary to use the strategy
another question: How long is the object instantiated? will you destroy it after each use or do you create it once and just call the order-functions when needed?

thank you very much
askerix

Reply With Quote
 
  #12 (permalink)
Elite Member
Houston,Tx
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,208 given, 4,293 received


askerix View Post
TMFT,

great idea to create a strategyobject within the indicator. I've worked around that charttrader/strategy-issue before with a separate window for my strategy buttons - but that opens a lot new possibilities.

I tried to test it with a dummy strategy but failed with the integration into the indicator.
It would be great if you can share a code sample which
  • creates the object (skip that - you've done already)
  • defines the used account (do you have to set the enable property of the strategy object to false while adjusting the Account?)
  • other preparations necessary to use the strategy
another question: How long is the object instantiated? will you destroy it after each use or do you create it once and just call the order-functions when needed?

thank you very much
askerix

@askerix

I use it simply to place orders for me when I push a button.

I press the Buy Range Button; the indicator calls the strategy (created earlier as you normally would), passes the order information to it, the strategy creates the order from the received info and places a stop limit order 1 tick above the projected end of the bar.

If price moves away, I press the Close Button and the order is cancelled.

If it gets filled the ATM strategy takes over. At that point I can drag the stops and targets without an issue.

There is no enable/disable with the strategy.

To use this for a regular strategy I suppose you would have to write all the conditions in the indicator and when the conditions were met, instead of plotting something, it would pass the order info to the strategy which would generate the order.

A professional programmer could pass info both directions. But I'm not a programmer. I cobble stuff together and hack on it until it works. If we were talking about cars I would be a Shade Tree Mechanic.

Hope that helps.

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
 
  #13 (permalink)
Elite Member
Zurich, Switzerland
 
Futures Experience: None
Platform: NT
Favorite Futures: Ukulele
 
Posts: 16 since Mar 2011
Thanks: 342 given, 14 received



ThatManFromTexas View Post
@askerix

I use it simply to place orders for me when I push a button.

I press the Buy Range Button; the indicator calls the strategy (created earlier as you normally would), passes the order information to it, the strategy creates the order from the received info and places a stop limit order 1 tick above the projected end of the bar.

If price moves away, I press the Close Button and the order is cancelled.

If it gets filled the ATM strategy takes over. At that point I can drag the stops and targets without an issue.

There is no enable/disable with the strategy.

I want to use it in the exact same way - also searching for a possibility to enter StopLimits over a Chart Trader button.
I tried to call my test strategy - it's working ( i can do a print-statement within) but the AtmStrategyCreate fails with the error "Object reference not set to an instance of an object.". so something still wrong within the strategy.
If you could help with a short code example it would save me several evenings digging into that

askerix

Reply With Quote
 
  #14 (permalink)
Elite Member
Houston,Tx
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,208 given, 4,293 received


askerix View Post
I want to use it in the exact same way - also searching for a possibility to enter StopLimits over a Chart Trader button.
I tried to call my test strategy - it's working ( i can do a print-statement within) but the AtmStrategyCreate fails with the error "Object reference not set to an instance of an object.". so something still wrong within the strategy.
If you could help with a short code example it would save me several evenings digging into that

askerix

@askerix

The ATM....


 
Code
  #region Variables
		private string	atmStrategyId		= string.Empty;
		private string	orderId				= string.Empty;
		private int atmname_i = 11; // Default setting for Atmname
		private string	type				= string.Empty;
		private string atmname = "";
		
        #endregion

        /// <summary>
        /// This method is used to configure the strategy and is called once before any strategy method is called.
        /// </summary>
        protected override void Initialize()
        {
            CalculateOnBarClose = false;
            atmname = "tmft" + Convert.ToString (atmname_i);
			EntriesPerDirection = 1;
    		EntryHandling = EntryHandling.AllEntries;
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
			
			
        }

       

        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;

There is some more info here....

https://futures.io/download/vip_elite_circle/900-download.html?view

NinjaTrader Chart Trader Indicator

dsChartTrader - NinjaTrader Strategy

Tools and indicators for NinjaTrader

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
The following user says Thank You to ThatManFromTexas for this post:
 
  #15 (permalink)
Elite Member
Bala, PA, USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus, IB
Favorite Futures: SPY, Oil, Euro
 
monpere's Avatar
 
Posts: 1,858 since Jul 2010
Thanks: 300 given, 3,276 received


askerix View Post
I want to use it in the exact same way - also searching for a possibility to enter StopLimits over a Chart Trader button.
I tried to call my test strategy - it's working ( i can do a print-statement within) but the AtmStrategyCreate fails with the error "Object reference not set to an instance of an object.". so something still wrong within the strategy.
If you could help with a short code example it would save me several evenings digging into that

askerix

"Object reference not set to an instance of an object." Make sure you initialize every varialbe when your declare it. Ex:

int i = 0;
string text = "";
double d = 0;

Reply With Quote
 
  #16 (permalink)
Elite Member
Houston,Tx
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,208 given, 4,293 received


askerix View Post
I want to use it in the exact same way - also searching for a possibility to enter StopLimits over a Chart Trader button.
I tried to call my test strategy - it's working ( i can do a print-statement within) but the AtmStrategyCreate fails with the error "Object reference not set to an instance of an object.". so something still wrong within the strategy.
If you could help with a short code example it would save me several evenings digging into that

askerix

@askerix

Check the download section, posted by Bukkan

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

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
 
  #17 (permalink)
Elite Member
Zurich, Switzerland
 
Futures Experience: None
Platform: NT
Favorite Futures: Ukulele
 
Posts: 16 since Mar 2011
Thanks: 342 given, 14 received

@TMFT, @monpere

thanks for your support. I've tested further and identified where the Object error comes from - all Strategy related Properties lie TickSize or Instrument raises that error.
It seems to me, that the Strategy object is not properly instanciated with that code
 
Code
private NinjaTrader.Strategy.TMFTGuidedStrategy trader;   
trader = new NinjaTrader.Strategy.TMFTGuidedStrategy();

void OnBuy(object sender, System.EventArgs e)                      
{                         
 trader.EnterPosition(OrderAction.Buy,OrderType.Stop, 1, rangeHi, 0, 0, buyRange);                      
}
I placed debug output in several methods like initialize - it's not called only if I build my call to initialize within the class on my own.

if I assign
trader.Account = <TheCharttraderAccount> - then I can query the Account within the strategy otherwise it's empty... .

probably you have further hints

regarding the links - I've read them all, since I'm following the topic since TMFT started his first indicator search on that.

thanks
askerix

Reply With Quote
 
  #18 (permalink)
Elite Member
Europe
 
Futures Experience: Intermediate
Platform: NinjaTrader, CQG Trader
Broker/Data: Mirus
Favorite Futures: currency futures, forex
 
Posts: 72 since Apr 2010
Thanks: 36 given, 20 received

Hello,

thanks for sharing this. But I´ve got a problem. When I add this to the OnBarUpdate and when I want to enable my strategy after checking/enabling its immediately again unchecked and disabled.

Did you change or add anything else too?

Thanks
Tony



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


Reply With Quote
 
  #19 (permalink)
Elite Member
Germany
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 15 since Jan 2013
Thanks: 4 given, 0 received

Why NinjaTrader doesn´t allowed to use both? ChartTrader and Strategy together?
What was the intention to avoid the simultaneously usage?

Some people need the strategy calculations to obtain signals and the chart trader to execute them.

Reply With Quote

Reply



futures io > > > > > Open ChartTrader with Strategy

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
ChartTrader bukkan NinjaTrader Programming 7 August 3rd, 2012 01:25 AM
Logical error in the strategy based on open types Alexlaxmikant EasyLanguage Programming 7 May 2nd, 2012 09:21 AM
ChartTrader Indicator louiswelt NinjaTrader 1 June 16th, 2011 12:03 AM
Strategy to open only 1 trade peter88 NinjaTrader Programming 7 January 25th, 2011 01:47 PM
Volitility indicator question - Open - Open / open - close / close to open andresimon NinjaTrader 2 September 27th, 2010 01:33 AM


All times are GMT -4. The time now is 12:54 PM.

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-18 in 0.14 seconds with 20 queries on phoenix via your IP 54.196.201.241