![]() |
|
|||||||
| ATM Strategies (Discretionary Trading) Support for Advanced Trade Management, AutoTrail, AutoBreakeven, Stop Strategy and Simulated Stops etc... |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Mar 2010
Posts: 320
Thanks: 87
Thanked 5 times in 5 posts
|
Hi Guys. I have an ATM strategy question. I'm using this code to create an ATM strategy buy order:
PHP Code:
Any ideas on this one? Thanks in advance DJ |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
Thanks for the note. Appears you got a part fill, as you were only filled with 51 contracts. You were not actually 100 contracts long therefor, you didn't have the full 50 target 1 and 50 target 2 QTY's. NinjaTrader will submit and modify the stops as you get filled so that you never have a position unprotected, even if you get part filled. -Brett
Brett
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Brett for this post: |
|
|
|
#3 |
|
Senior Member
Join Date: Mar 2010
Posts: 320
Thanks: 87
Thanked 5 times in 5 posts
|
Thanks Brett, I don't think a partial fill was the issue because I was getting 51 all the time. I realized I'd done something else which had caused some problem with the original ATM strategy so fixed now. I have a another issue though. I'm trying to calculate a reward $ figure based on the type of instrument being a future or a stock.
For futures I use this formula which works well: PHP Code:
Thanks DJ |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
The point value is fine as point value is just 1 for stocks. Most likely is the rounding in that case. -Brett
Brett
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Brett for this post: |
|
|
|
#5 |
|
Senior Member
Join Date: Mar 2010
Posts: 320
Thanks: 87
Thanked 5 times in 5 posts
|
Hi Brett, here is another separate question as well. I've attached the AMT strategy. What I want to do is use the same template for multiple instruments but change the quantity for different instruments. For example I've put this in the initialize section.
PHP Code:
1. The first problem is if I run this and buy AAPL it isn't buying 300 but only 100 as per the strategy. 2. The second issue is even if it had purchased 300 AAPL shares how do I tell it the targets should be split into two so would be 150 for each target? Thanks in advance DJ |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
1) I would set this in OnStartUp(). As in Initialize() it can be overridden by the user. 2) This is determined by the strategy, you would need an ATM strategy setup for each stock and each QTY level unfortunately.. -Brett
Brett
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Brett for this post: |
|
|
|
#7 | |
|
Senior Member
Join Date: Mar 2010
Posts: 320
Thanks: 87
Thanked 5 times in 5 posts
|
Quote:
Thanks DJ |
|
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Brett
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Brett for this post: |
|
|
|
#9 |
|
Senior Member
Join Date: Mar 2010
Posts: 320
Thanks: 87
Thanked 5 times in 5 posts
|
Hi Brett, thanks this will help me once I'm in the trade. Let me explain further. Here is a chart of oil. I have programmed it so as I move the stop and target lines up and down it will calculate the risk/reward before entering the trade so I can see my risk and return prior to entry (see top left table). I need to do this for stocks as well so not sure why it doesn't work the same. It is something to do with this point value part as that's were it is all turning to custard.
I think what I need to do is access is the Qty for target 1 and Qty for target 2 in the ATM Strategy parameters section. I don't why this is working differently from the way futures are doing it. Cheers DJ |
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
To clarify, you need to computer while the previous trade is going? Wouldn't you only be computing this before entry or will you be doing this after entry?
-Brett
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Mar 2010
Posts: 320
Thanks: 87
Thanked 5 times in 5 posts
|
Hi Brett, sorry for the confusion. There is no trade going and it's only before entry. So as I move the lines around the Reward is constantly updating in the table
Once in the trade it's fixed based on the before entry calculation. I just tried out this here and notice it only works once you are in the position and not prior to entering the position. PHP Code:
double Reward2T= Math.Round(((reward1+reward2) * Instrument.MasterInstrument.PointValue), 2, MidpointRounding.AwayFromZero); Cheers DJ
Last edited by djkiwi; 06-15-2012 at 01:40 PM.
|
|
|
|
|
|
#12 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
Thanks. Correct will only work after you are in the trade. Lastly the difference here is still the rounding. Ir probably works on XXXX.XX instruments like the ES but not XX.XX instruments might be the missing factor. -Brett
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#13 |
|
Senior Member
Join Date: Mar 2010
Posts: 320
Thanks: 87
Thanked 5 times in 5 posts
|
Hi Brett, now I feel like a fool. Because it's a stock it's in denominations of $1 so the Point Value is incorrect for stocks. So what I need to do is multiply it by 100. So I think you guys need to say if it is a stock set the point value to 100 not 1.
I have a chart where you can see it working correctly. Here is the code: PHP Code:
DJ |
|
|
|
|
|
#14 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
The difference is a point for stocks is 1 cent. A point for the ES is 4 ticks. Not really a right or wrong way to do it but we wouldn't change it now. -Brett
Brett
NinjaTrader Customer Service |
|
|
|
|
|
#15 |
|
Senior Member
Join Date: Mar 2010
Posts: 320
Thanks: 87
Thanked 5 times in 5 posts
|
Hi Brett, yes you are right 1 cent. I suggest Ninjatrader consider changing it because it is simply incorrect as it stands. All stocks are 1 cent so the point value should be 100 not 1 for all stocks.
Bear in mind you wouldn't need point value at all if all futures were the same denomination. In any case thanks for your patience on this issue. Much appreciated. Cheers DJ
Last edited by djkiwi; 06-15-2012 at 02:58 PM.
|
|
|
|
|
The following user says thank you to djkiwi for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Setting Initial Stop Loss Using ATM | Mr_T_Fx | Strategy Development | 1 | 08-21-2011 06:30 AM |
| MOC order if ATM setting not reached? | vero-chan | ATM Strategies (Discretionary Trading) | 1 | 04-18-2010 01:53 PM |
| HELp plz. with setting up new ATM......... | mdsvtr | ATM Strategies (Discretionary Trading) | 1 | 03-11-2010 11:53 AM |
| Help setting up these ATM Strategys please.... | mdsvtr | ATM Strategies (Discretionary Trading) | 2 | 03-08-2010 01:07 PM |
| Re: Setting a trailing stop & ATM Strategy | mikesbarrett | SuperDOM and other Order Entry Windows | 1 | 06-29-2007 08:57 AM |