![]() |
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 |
|
Junior Member
Join Date: Aug 2012
Posts: 10
Thanks: 0
Thanked 1 time in 1 post
|
I couldn't find the information on vids on how to set up a strategy using just time of day? I have tried a couple of different approaches but everytime I try and activate the conditions box. The box doesn't load.
I don't want to use any indicators - I just want to buy a group of futures near 4pm and sell them at 7:30am. Would someone be willing to post a tutorial or screen shots to get me started. Thanks, Mike |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Mike,
Welcome to the forum and I am happy to assist you. You can compare the bar time to filter your trading time. Unfortunately there are no videos but you can refer to this sample code which further illustrates it. http://ninjatrader.com/support/forum...ead.php?t=3226 Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2012
Posts: 10
Thanks: 0
Thanked 1 time in 1 post
|
Hi Joy,
I downloaded the zip file but when I went to import it into my strategy I got a message telling me it had errors in it that need to be fixed. Suggestions? thanks mike |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello gonetowindsurf
Thank you for writing in. Please follow the instructions below to see where the errors are coming from after compiling the indicator. This will allow you to debug the indicator/strategy or remove it from your PC. If you are wondering why you receive an error when compiling only one indicator, it is because NinjaTrader compiles all indicators and strategies- not just one. • Open NinjaTrader • From the Control Center select the Tools menu--> select the Edit NinjaScript menu item--> select Indicator • Select an indicator and double click on it. • A new window will appear and you will need to right click in the window and select Compile to compile the indicators. • At the bottom of the window a new section will appear where you can find the error locations. • From there you have the option to remove the indicator or debug it. Here is a video of this process: • http://screencast.com/t/K3plVBblUy Also here is a forum post that describes the process and offers ways to resolve the situation: • http://www.ninjatrader.com/support/f...ead.php?t=4678 If you are unsure as to what the error is indicating, please send me a screenshot of the error with the name and description fields clearly readable. To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CRTL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment. Please let me know if I can provide any further assistance.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Mar 2012
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
|
Ninja_Support, please correct me if I am wrong.
In your strategy, under the OnBarUpdate() section, you can have something like this if (ToTime(Time[0]) == ToTime(15, 55, 0)) { // Buy a group of futures } if (ToTime(Time[0]) == ToTime(7, 30, 0) ) { // Sell the group of futures } |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Aug 2012
Posts: 10
Thanks: 0
Thanked 1 time in 1 post
|
Hi Joy,
I am going to just delete all the sample strategies and reload the download you provided. They are just sample scripts that I have no use for - make sense? mike |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Aug 2012
Posts: 10
Thanks: 0
Thanked 1 time in 1 post
|
Apparently I cannot delete a strategy until i fix the error? It would be simpler just to punt it - not sure i reeeeely want to try and figure out an error - would rather just start from jump again - no? I am not the sharpest tool in the shed. Is there annny other way other than trying to find an error?
mike |
|
|
|
|
|
#8 | |
|
Senior Member
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
|
Quote:
Marco |
|
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Dec 2009
Location: Netherlands
Posts: 179
Thanks: 15
Thanked 72 times in 51 posts
|
Mike,
I also got the impression you were using the StrategyWizard to create your strategy, aren't you ? Just making sure we're not bombarding you with all sorts of C# code which you aren't familiar with. ![]() Marco |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Mar 2012
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
|
Mike, you must delete the strategy or indicator that gave you the error while compiling, first. The way to do that is go to Tools -> Edit NinjaScript -> Strategy. You will see a list of strategies. Select the strategy that is giving you the error and click "Delete". After deleting the script, you then click "Cancel" to get out of the Edit Ninjascript menu. Once you delete the script that gave you the error, you would be able to compile other scripts.
Hope this helps. |
|
|
|
|
|
#11 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello gonetowindsurf,
So that I can assist you further can you send a contact number to support[AT]ninjatrader[DOT]com Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email. @mhaus Yes, you can have that code on OnBarUpdate.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Aug 2012
Posts: 10
Thanks: 0
Thanked 1 time in 1 post
|
#region Using declarations
using System; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Data; using NinjaTrader.Indicator; using NinjaTrader.Gui.Chart; using NinjaTrader.Strategy; #endregion // This namespace holds all strategies and is required. Do not change it. namespace NinjaTrader.Strategy { /// <summary> /// Enter the description of your strategy here /// </summary> [Description("Enter the description of your strategy here")] public class overnight : Strategy { #region Variables // Wizard generated variables // User defined variables (add any user defined variables below) #endregion /// <summary> /// This method is used to configure the strategy and is called once before any strategy method is called. /// </summary> protected override void Initialize() { CalculateOnBarClose = false; } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { } #region Properties #endregion } } #region Wizard settings, neither change nor remove /*@ <?xml version="1.0" encoding="utf-16"?> <NinjaTrader> <Name>overnight</Name> <CalculateOnBarClose>False</CalculateOnBarClose> <Description>Enter the description of your strategy here</Description> <Parameters /> <State> <CurrentState> <StrategyWizardState xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Name>Flat</Name> <Sets> <StrategyWizardStateSet> <Actions /> <Conditions /> </StrategyWizardStateSet> </Sets> <StopTargets /> </StrategyWizardState> </CurrentState> </State> </NinjaTrader> @*/ #endregion |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Aug 2012
Posts: 10
Thanks: 0
Thanked 1 time in 1 post
|
I am going to uninstall and then re install and see if i can start fresh -
|
|
|
|
|
|
#14 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Please email us at support if you need further assistance on this.
-Brett
Brett
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Buys and Sells not matching in number | richwaters | Strategy Development | 3 | 02-23-2011 04:46 AM |
| Plotting Buys & Sells | Crumbs | Automated Trading | 7 | 01-19-2010 06:11 PM |
| Changing timeframe loses buy/sells | theoracle | Strategy Analyzer | 1 | 12-21-2008 02:43 PM |
| Plotting Buys and Sells on chart | SystemTrading | General Programming | 1 | 10-21-2008 07:03 AM |
| resetting flag at end of day or a certain time of day | sauer11155 | Strategy Development | 5 | 09-23-2008 08:30 AM |