NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 01-31-2011, 06:00 AM   #1
meegwell
Member
 
Join Date: Jan 2011
Posts: 51
Thanks: 0
Thanked 0 times in 0 posts
Default Some stop loss realted questions...

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
meegwell is offline  
Reply With Quote
Old 01-31-2011, 06:45 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

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.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 02-03-2011, 10:16 AM   #3
larry2010
Junior Member
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 times in 0 posts
Default Clarification on Stair Stop Script

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.
larry2010 is offline  
Reply With Quote
Old 02-03-2011, 10:48 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

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)
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 04:47 PM.