![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Oct 2008
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
I'm trying to plan some executions around the High of the Day and the Low of the Day.
What is the easiest way to do this in the condition builder? Can't seem to figure out how to get it to find the HOD or LOD Thanks |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Jul 2008
Location: Denver, CO, USA
Posts: 1,828
Thanks: 4
Thanked 19 times in 18 posts
|
Hello,
Thank you for your post. In the condition builder of Strategy Analyzer, you will find High/ Low wich you can set to the current bar, or day. Please see my attachments as an example.
Ray S
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2008
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
When I plugged in your sample, it triggered trades from high's above bars and not triggering trades only at the HOD. Did I need to change something to make it HOD instead of at a bar?
Thanks, Bryan |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Jul 2008
Location: Denver, CO, USA
Posts: 1,828
Thanks: 4
Thanked 19 times in 18 posts
|
Hello,
Can you please explain to me the exact condition you are looking for? Do you wish to enter your trade after the current price exceeds yesterday's high? Do you wish to enter your trade after the current price makes a new high for the current day? If so, you need to specify the time range, 1 hour high, 30 min high, etc.
Ray S
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Oct 2008
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
I wish to setup trades just below the current high of the current day. Also sell just above the current low of the current day.
I see you say 1 hour high, 30 min high.... How do you set DAY high or DAY low? When I plug it in, it is executing trades based on bars back. Not based on price back. Thanks for your help. |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Jul 2008
Location: Denver, CO, USA
Posts: 1,828
Thanks: 4
Thanked 19 times in 18 posts
|
Hello,
You will need to use the indicator CurrentDayOHL and set the plot to Current High.
Ray S
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Oct 2008
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
So do I put those on both sides with a "==" in the middle? like you had mentioned below?
Trades are still executing above the lowest price of the day and not enough trades are being made. It looks like it is executing on the open or close of a candle and not within a candle. Thanks |
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Post up screenshots of what you have now so we can better assess the next step. Thanks.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Oct 2008
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
Here are some pics about the problem..
You will at 9:17 a.m. it executes a short higher than the current LOD of 1282.25.. Why? Is this a simple change. |
|
|
|
|
|
#10 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Hi tahoebry,
Your code looks correct. Possible reason could be that the bar's low is actually the current day's low, but since you are submitting market orders it just happened to fill at a higher price. This can happen and the only way to prevent would be to use limit orders.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Market Trades don't always execute | malbeth35 | Strategy Development | 4 | 09-24-2008 05:36 PM |
| Order won't execute? | edgeliner | General Programming | 11 | 12-12-2007 09:01 AM |
| What bar does order execute? | Folls | Strategy Development | 1 | 05-15-2007 01:22 PM |
| Failed to execute DB job | ratherBgolfing | Automated Trading | 7 | 04-14-2006 05:18 AM |
| Failed to Execute error | werosen | Miscellaneous Support | 7 | 01-12-2006 02:57 AM |