Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Profit Target with ATM Strategy Methods
Collapse
X
-
Hello teafortwo,
Thank you for your reply.
No, the stop loss cannot be originally set using AtmStrategyChangeStopTarget(), this would only modify the stop after an ATM Strategy has been created using an ATM Template and ATMStrategyCreate().
I've included a very basic example strategy that may be viewed in the strategy builder that uses Order submission methods rather than ATM Strategy Methods which is attached to this post.
We do have resources to help you begin creating NinjaScript Strategies/Indicators. All links below are publicly available.
The best way to begin learning NinjaScript is to use the Strategy Builder. With the Strategy Builder you can setup conditions and variables and then see the generated code in the NinjaScript Editor by clicking the View Code button.
I'm also providing a link to a pre-recorded set of videos 'Strategy Builder 301' and 'NinjaScript Editor 401' for you to view at your own convenience.
Strategy Builder 301
NinjaScript Editor 401
If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our NT7 help guide first:
Basic Programming Concepts
For general C# education I have personally found Dot Net Perls to be a great reference site with easy to understand examples.
https://www.dotnetperls.com/
There are a few Sample Automated Strategies which come pre-configured in NinjaTrader that you can use as a starting point. These are found under New -> NinjaScript Editor -> Strategy. You will see locked strategies where you can see the details of the code, but you will not be able to edit (you can though always create copies you can later edit via right click > Save as)
We also have some Reference samples online as well as ‘Tips and Tricks’ for both indicators and strategies:
Click here to see our NinjaScript Reference Samples
Click here to see our NinjaScript Tips
These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.
Further, the following link is to our help guide with an alphabetical reference list to all supported methods, properties, and objects that are used in NinjaScript.
Alphabetical Reference
And our Educational Resources in the NinjaTrader 8 help guide.
Educational Resources
A set of specific tutorials for creating conditions in the NinjaTrader 8 Strategy Builder in the NinjaTrader 8 help guide.
Condition Builder
You can also contact one of our professional NinjaScript Consultants or Educators who would be eager to create or modify this script at your request or assist you with your script. Please let me know if you would like a list of professional NinjaScript Consultants or Educators who would be happy to create or modify any script at your request or assist you in learning NinjaScript.
Please let me know if I may be of further assistance.
Attached Files
Leave a comment:
-
Yes I would like to receive more information on programming strategies.
I am looking for an dynamic way to set the profit target with script function.
And, stop loss can be set:
AtmStrategyChangeStopTarget(0, Close[0] + 50 * 0.25, "Stop1", atmStrategyId);
How can I set the profit target?
Leave a comment:
-
Hello teafortwo,
Thank you for your reply.
ATMStrategyCreate does not simply set a profit target and it is not possible to set just a profit target and no stop loss with an ATM Strategy. Using ATMStrategyCreate creates an entry order and specifies the ATM Template to be used with that entry, which then manages stops and targets as specified in the selected ATM Strategy Template. As I mentioned previously, you can see the correct usage in the built in strategy Sample ATM Strategy.
You can certainly program a strategy without using ATM Strategy methods and submit profit target and/or stop loss orders for an opened position. If you'd like more information on programming strategies without using ATM methods, please let me know.
Please let us know if we may be of further assistance to you.
Leave a comment:
-
No I just like to set a profit target with the function AtmStrategyCreate(). Could you give me an example?
Leave a comment:
-
Hello teafortwo,
Thank you for your post.
To confirm, you are wanting to utilize your pictured ATM Strategy template in a NinjaScript Strategy, is that correct?
Here's a link to our help guide that goes over the basics of using ATM Strategy methods in an automated strategy:
https://ninjatrader.com/support/help...strategies.htm
Here's a second link listing the available methods for working with ATM Strategies within a NinjaScript strategy:
https://ninjatrader.com/support/help...gy_methods.htm
There's an example strategy that is built into NinjaTrader which you can view from the NinjaScript Editor called Sample ATM Strategy that you can save a copy of and modify that should give you good direction to get started on using your own ATM templates in a NinjaScript strategy. Note you will need an existing ATM Strategy Template to test this script called "AtmStrategyTemplate" set up from Chart Trader or the SuperDOM prior to testing. Keep in mind that ATM Strategies operate in real-time only and will not execute on historical data thus they can't be backtested.
Please let us know if we may be of further assistance to you.
Leave a comment:
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by onnb1, Today, 02:08 PM
|
0 responses
6 views
0 likes
|
Last Post
![]()
by onnb1
Today, 02:08 PM
|
||
Started by omermirza, Today, 01:15 PM
|
2 responses
13 views
0 likes
|
Last Post
![]()
by omermirza
Today, 01:58 PM
|
||
Started by stevenev1, Today, 01:24 PM
|
2 responses
10 views
0 likes
|
Last Post
![]()
by stevenev1
Today, 02:25 PM
|
||
Started by morrisonrob, Today, 12:59 PM
|
1 response
8 views
0 likes
|
Last Post
|
||
Started by JTizz, Today, 01:00 PM
|
1 response
8 views
0 likes
|
Last Post
|
Leave a comment: