Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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
Can you help answer these questions from other members on NexusFi?
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!"
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
NinjaTrader by default disables the Chart Trader when one uses any strategy. This is a limitation which often bogs traders. Chart Trader indicator demonstrates how to send orders via an indicator.
Here in the sample indicator you can send Limit orders, …
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
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 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.