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)
You cannot do advanced trade management with an indicator. The only order management method I know of that can be used inside and indicator is CreateOrder(). That is the method used in the bTPA indicator to open trades, but it uses a hot key to close the trades. If you want to do things like move stops, targets, partial exits, cancel orders, etc. those methods are only available in strategies.
I interface my indicator with my strategy using the windows clipboard. When I press the 'BE' button on my chart, the indicator puts the following command on the windows clipboard '<NTcmd> BreakEven </NTcmd>' using Clipboard.SetText(). My strategy reads the windows clipboard using Clipboard.GetText(), sees the 'BreakEven' command, and executes SetStopLoss(...). I have many other specialized button commands implemented such as 'BuyCloseOfBar', 'SetTarget+1RMultiple', 'SetStop-1', 'TrailBy2Bars', 'TrailDownBars', 'PauseStrategy', 'BreakEven', 'ExitHalf', etc. You can only implement these types of functionality with strategies, and your code will be supported by NinjaTrader.
I couldn't locate the ChartButtons indicator in the download section? Were you referring to Ninja's forum, or the forum with Big Mike's? I looked at Big Mike's, but could not locate it under /Indicators, /Strategies, or /Misc?
You mention having the ability to enable ChartTrader while running the strategy. Whenever I close a position with ChartTrader it disables whatever strategy has initiated the order. Do you have a way to avoid this?
That is true. Closing a position with a charttrader close button will terminate the strategy. I don't think you can avoid it. I generally close trades manually by moving the target order on the chart, in which case, the strategy will not terminate.
I created an indicator that (1) Creates the Buttons on the Chart Trader (2) Calls a strategy that generates a buy or sell order (3) Calls an ATM strategy to handle the stops and targets
Pressing the Buy or Sell Buttons on the chart trader causes the indicator to pass that information to the strategy which issues the orders and invokes the ATM strategy to handle the stops and targets.
Once the orders are generated, the stops and targets can be moved without affecting the strategy.
The Close Button on the Chart Trader closes all orders but doesn't affect the strategy since it is invoked by an indicator running on the same chart as the Chart Trader.
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!"
Is the close button on the chart trader the default close button from NT, or is it a button that you created in the chart trader, that tells the strategy to close the trade?
Have you read through this thread ? It may be of interest and maybe you can suggest (NOT code 'cos of your Med's advice) some codes that can take the bPTA indicator to a new level. I particularly initially had a challenge on the Close button implementation of bPTA 'cos the NT/Windows keyboard mapping setup does not conform with the keyboard combinations on my Mac machine, but I eventually got over it. Have a look @ my post here.
I have the same question as monpere regarding the Close button. Also, are you using monpere's method of passing orders to a strategy via the clipboard, or something else?
The other approach I'd thought of is to rework the ChartTrader itself and invoke the eventhandlers associated with its buttons to submit orders. But that would limit the order types to Buy Market, Buy Bid etc.