![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
Join Date: Aug 2008
Posts: 109
Thanks: 0
Thanked 0 times in 0 posts
|
There is the SetStopLoss and SetProfitTarget, which are sort of the easy way as I see it. Then as the sample shows there is the advanced way by using OnExecution and handling it yourself.
Would it be fair to say the most advanced implementations would use OnExecution? My questions is if that's true, I take it you'd also have to handle scaling on your own in that event as well since the sample that shows scaling makes use of SetStopLoss, SetProfitTarget and SetTrailingStop(). |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Correct. If you opt for using IOrders to manage your trade you will basically want to manual everything. It allows you the most flexibility in how you want to trade, but requires much more coding. If you feel the Set() methods provide enough functionality for your strategy then I would recommend just using those and save yourself the headache from the added complexity of IOrders.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Senior Member
Join Date: Aug 2008
Posts: 109
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
|
|
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
It is up to you which method you wish to use. You can still do things like breakeven with Set() methods as demonstrated in this reference: http://www.ninjatrader-support.com/v...ead.php?t=3222
The OnOrderUpdate()/OnExecution() example is there just to show you some basic functionality. I believe it can be done with Set() also. The purpose of the OnOrderUpdate() and other advanced methods is for people who wish to control their orders in different ways.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Aug 2008
Posts: 109
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
|
|
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Right. Just keep in mind that Set() do not produce IOrder objects.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Best ways to trade live with 2 broker connection/account? | pipal | Connecting | 13 | 07-22-2008 05:58 AM |
| protection level error on compile | ATI user | General Programming | 11 | 03-08-2008 01:38 PM |
| Password protection | ct | Suggestions And Feedback | 14 | 01-28-2008 02:53 AM |
| Protection Level | goldfly | Strategy Development | 2 | 06-09-2007 11:30 AM |
| Submit Limit Entry Order and Stop Loss Order at same time? | aspTrader | Miscellaneous Support | 2 | 10-04-2006 02:40 AM |