I found how to make enable chart trade while running a strategy on the chart. I put this code in the OnBarUpdate method:
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
The following 3 users say Thank You to nailz420 for this post:
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....
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 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....
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.
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.
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.
What about the TMFTGuidedStrategy strategy codes ? Also, could you suggest a name for the indicator, or better still, the complete codes of the indicator.
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.
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!"
The following user says Thank You to ThatManFromTexas for this post:
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 ...
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.
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!"
The following user says Thank You to ThatManFromTexas for this 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
The following 2 users say Thank You to lolu for this post:
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?
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?
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 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
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, …
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:
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
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
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
Hi,
I found how to make enable chart trade while running a strategy on the chart. I put this code in the OnBarUpdate method:
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?