![]() |
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
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |||
|
Senior Member
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 329
Thanks: 0
Thanked 11 times in 8 posts
|
I am trying to use variables as my stop and profit target values but it doesn't seem like they are working. I built this in the strategy wizard then opened it up to finish adding the details that can't be done in the wizard. Basically when I enter a long or short position, at the same time I set Variable0 as the stop (based on MIN Low - a tick) after 1 bar I set Variable1 as the profit target (MAX High - 1 tick). I'm using named entries and pairing my profit targets to those named entries. Stops I leave open for future planning for multiple contracts at different profit targets. Here's the code for setting the profit and stop code and setting the variables:
Quote:
Quote:
Quote:
Why aren't variables working as targets? They seem to be updating correctly, and I am setting the variables equal to the value of interest from the previous bar [1] not [0] beause exceeeding a max high on bar 0 won't work. thanks DaveN
Last edited by daven; 07-26-2010 at 05:36 PM.
Reason: Typos
|
|||
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
|
daven, please ensure you reset your stops and targets when you're in a flat position with your strategy - http://www.ninjatrader.com/support/f...ead.php?t=3222
Also: TraceOrders are helpful to debug your 'under the hood' order behavior more detailed - http://www.ninjatrader.com/support/f...ead.php?t=3627
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Tags |
| dynamic targets, trailing stop, variable0, variables |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| stop loss & profit target orders get activated only after buy stop order is execute | clearpicks | Automated Trading | 1 | 07-21-2010 06:18 AM |
| Profit Target/Stop Loss | kaoz85 | Strategy Development | 1 | 01-15-2010 05:21 AM |
| Using Unrealized Profit for Stop Loss and Profit Target | dancorcal | Strategy Development | 1 | 12-17-2009 10:12 AM |
| How do i add profit and stop target? | Greenmoney21 | SuperDOM and other Order Entry Windows | 10 | 07-09-2008 11:11 AM |
| profit target - no stop | Futures_Shark | Suggestions And Feedback | 1 | 08-14-2007 10:51 PM |