Is there a simplest sample trade script? Maybe manual or reference? Functions? Global reserved variables? Getting a bit stunned by the unfamiliar syntax... Can you help, please?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
What to start with?
Collapse
X
-
Hello greed999,
Welcome to the NinjaTrader forums. One of the simpler ones is built into the platform. Click Tools > Edit NinjaScript > Open SampleMaCrossOver
This help guide page on the strategy development process is a good place to start:
Using the condition builder will allow you to create conditions and actions in a point and click interface, and view code for these. That will help you get familiar with the syntax.
Ryan M.NinjaTrader Customer Service
Comment
-
I think reading through the manual will help you get the job done. You first have to develop your strategy. If you are not familiar with it yet, describing a strategy means setting your own rules that would define when you will enter or exit a market.
You can do this with strategy wizard using condition builder as what is already said in the post below me. It has been a free breeze even if you are still starting out as it is ideal for new users who can even be non programmers.
Comment
-
Well, thanks for those links folks, everything is getting better... But still not everything is clear...
Can someone please give an example where the script buys when price reaches some predifined value? Let's say A. And sells when either stoploss reaches B or takeprofit reaches C?
Should I use only three methods or there must be smth. else?
As far as I understand
1) Initialize() is used for predefined variables
2) OnBarUpdate() to get the price and this is the place to enter the market
But where the portfolio is calculated? Should I still use OnBarUpdate() to take profits for instance?Last edited by greed999; 06-17-2011, 02:54 PM.
Comment
-
We do not have exact examples for this. The structure of the scripts is best explained by going through the indicator tutorials. These use similar structure to strategies:
You can also get additional info on the specific pages for these:
Profit targets and stop losses are automatically applied on entry execution, and can be defined based on your entry price if you use mode percent or ticks.
You can use other methods to place protective orders, but this may be a bit much if you're just learning. This sample can help once you're ready:
The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()Ryan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by junkone, Today, 11:37 AM
|
2 responses
15 views
0 likes
|
Last Post Today, 12:23 PM | ||
Started by frankthearm, Yesterday, 09:08 AM
|
12 responses
44 views
0 likes
|
Last Post Today, 12:05 PM | ||
Started by quantismo, 04-17-2024, 05:13 PM
|
5 responses
35 views
0 likes
|
Last Post Today, 11:32 AM | ||
Started by proptrade13, Today, 11:06 AM
|
1 response
7 views
0 likes
|
Last Post Today, 11:27 AM | ||
Started by love2code2trade, 04-17-2024, 01:45 PM
|
4 responses
36 views
0 likes
|
Last Post Yesterday, 10:31 PM |
Comment