![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Mar 2011
Location: Ukraine
Posts: 146
Thanks: 19
Thanked 2 times in 2 posts
|
Dear friends.
I have troubles with placeing market orders with my strategies. I have test on my PC and on my Notebook. I can't find even orders from my strategy. I have try sell and buy market orders. And got nothing. I have wrote simple strategy Code:
protected override void OnBarUpdate()
{
EnterLong(1,"buy");
EnterLong();
Print("EnterLong");
}
|
|
|
|
|
|
#2 | |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello daglas,
You have placed 2 long orders. Depending on your Entry handling/Entries per direction, one order may get cancelled. Since there are no condition filters and no exit/sell orders, the order(s) will be placed on the first bar of session (provided you have Exit on close set to true) and your strategy will remain in yellow state. Quote:
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Mar 2011
Location: Ukraine
Posts: 146
Thanks: 19
Thanked 2 times in 2 posts
|
How can I create a simple strategy which will open short / long position, at each new bar?
For example, I want to open long order at each new bar, because I know that price will rising. What should I do? I will close position manually,when I decide that profit size is enough for me. |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello daglas,
Unfortunately we cannot create this strategy code for you. We can however assist with specific questions you may have or issues you run into coding this yourself. Specifically for your question you would use EnterLong() for example inside of OnBarUpdate(). A sample of NinjaScript programming can be found here: http://www.ninjatrader.com/support/h..._cross_ove.htm You would replace the crossover logic here for what you want to happen. If you want it on each new bar just removing the crossover check will be fine. I would also have a if(Historical) return; to the code so that it only runs when you enable it live. http://www.ninjatrader.com/support/h...historical.htm To develop your custom indicator/strategies you can contact any of our independent NinjaScript consultants as well to do this code for you. You can get the list of our NinjaScript consultants from here http://www.ninjatrader.com/partners#...pt-Consultants
Joydeep M.
NinjaTrader Customer Service
Last edited by NinjaTrader_Brett; 07-11-2012 at 07:55 AM.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| troubles with saving opened orders and perfomance data | daglas | General Programming | 1 | 06-21-2012 11:07 AM |
| Troubles with instruments | Emanuele67 | Connecting | 3 | 05-16-2012 09:40 AM |
| troubles with export | daglas | General Programming | 1 | 04-20-2011 11:14 AM |
| Troubles with intraday data | jimmy.jared | Connecting | 3 | 04-18-2011 03:52 AM |
| troubles DataSeries | Nikoli | Indicator Development | 15 | 04-06-2010 10:19 AM |