![]() |
|
|||||||
| Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jan 2011
Posts: 51
Thanks: 0
Thanked 0 times in 0 posts
|
Hello,
I am primarily using the Strategy Wizard at this point - if this is not the appropriate sub-forum for these question let me know. Can I use and initial stop loss then a trailing stop as profit from market entry increases? Is this a script code only possibility? How do I create a math expression such as yesterdays close minus todays close to use in a strategy? I have another that I think needs a seperate title so Ill post it separately... thanks |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
meegwell, if you like to start with a static stoploss and then later on trail it as profit increases, yes this will need to be done outside of the wizard - http://www.ninjatrader.com/support/f...ead.php?t=3222
For your custom math, please create an indicator and then run this indicator in the strategy to access its values in your calcs.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Guys,
In your SamplePriceModification code: // Once the price is greater than entry price+50 ticks, set stop loss to breakeven if (Close[0] > Position.AvgPrice + 50 * TickSize) { SetStopLoss(CalculationMode.Price, Position.AvgPrice); } Are we assuming AvgPrice is the entry price and what is Ticksize, is it = 1pip? Also, you mentioned that Ninjatrader will ignore a stoploss for an open position, if there's an order for an entry that would open in the opposite direction, does this mean your stop loss will not work if you run a script that can go long and when conditions reverse, goes Short, meaning you can only ever run in one direction to have your stop losses working? or would you it work if you reversed the SamplePriceModification code to cater for a short position and included it on one script. |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Welcome to our forums - correct the entry is the avg price of the position, ticksize depend on your symbol and what is defined in the instrument manager, generally it's the smallest movement the symbol can make, so 1 pip for FX or 1/10 pip if the connection supports so called pipette values.
If you try to reverse with other order types than market orders you would run into the 'Internal Order Handling Rules' with the SetStopLoss working - http://www.ninjatrader.com/support/h...d_approach.htm (bottom section here)
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I change the stop-loss order into a stop-loss-limit order? | op684 | ATM Strategies (Discretionary Trading) | 10 | 01-23-2011 03:02 AM |
| Turning on and off the trailing stop feature of a stop loss set by an ATM | ohowie | ATM Strategies (Discretionary Trading) | 2 | 01-12-2011 03:19 AM |
| Stopp Loss Order Questions | brima | ATM Strategies (Discretionary Trading) | 6 | 10-18-2010 06:21 AM |
| Order Entry Property: Use stop market for stop loss orders | higler | SuperDOM and other Order Entry Windows | 7 | 07-02-2007 09:06 AM |
| Stop Loss Orders activated by number of trades past stop level | DoveforUsAll | Suggestions And Feedback | 1 | 02-08-2006 01:19 AM |