NexusFi: Find Your Edge


Home Menu

 





ATM and Limit Orders


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Big Mike with 2 posts (0 thanks)
    2. looks_two spinnybobo with 2 posts (0 thanks)
    3. looks_3 COTtrader with 1 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,748 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 1 attachments




 
Search this Thread

ATM and Limit Orders

  #1 (permalink)
 
spinnybobo's Avatar
 spinnybobo 
Crete, IL/USA
 
Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61

Hello All

I have a trend strategy that enters on the closing price of the latest finished bar when all conditions are met. so, it would go long at the high of the bar and short at the low of the bar.

The system is set for using Limit orders. I currently have it set for Market Order. I would like to set it for Limit Order, however, I like to forward test several different strategy settings using virtual machines, so I would not be there live to cancel the limit order if it gets too far away from the entry price.

I am using an ATM strategy. The code for the Limit order I found form NinjaTrader is:
if (orderId.Length == 0 && atmStrategyId.Length == 0 && Close[0] > Open[0])
{
atmStrategyId = GetAtmStrategyUniqueId();
orderId = GetAtmStrategyUniqueId();
AtmStrategyCreate(Cbi.Action.Buy, OrderType.Limit, Low[0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);
}

I would like to buy at the High[0] on close and cancel if price goes 6 ticks higher than the closing price without filling me. For short, sell at the Low[0] on close and cancel if price goes 6 ticks lower than the closing price without filling me

attached is a picture. in the lower left corner is a visual of the closing price either long or short in direction with arrows.

any ideas on how to program this?
thanks
Spencer

Attached Thumbnails
Click image for larger version

Name:	es.jpg
Views:	244
Size:	263.9 KB
ID:	15270  
Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Increase in trading performance by 75%
The Elite Circle
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
36 thanks
Tao te Trade: way of the WLD
24 thanks
Spoo-nalysis ES e-mini futures S&P 500
19 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,440 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,599


Working with ATM orders in Strategies will take a lot more code than you have there, because you have to do a lot of error checking and depending on your strategy you probably also need to track the open ATM position or possibly close it or modify it after the fact.

I'm sure you probably already know this, but ATM orders are not compatible with backtesting, just FYI. So you will only be able to test it in live data or market replay.

I don't have any code I can share for you because it was all written for paying customers back when I was doing this (I am not any longer), but I would say most likely you'll need to hire the work done at least the first time, to get your framework, and then if you know enough C# you can modify it from there.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 
max-td's Avatar
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
Posts: 1,752 since Jun 2009
Thanks Given: 2,309
Thanks Received: 927


Quoting 
I would like to buy at the High[0] on close and cancel if price goes 6 ticks higher than the closing price without filling me. For short, sell at the Low[0] on close and cancel if price goes 6 ticks lower than the closing price without filling me

and cancel if price goes 6 ticks higher than the closing price without filling me.

exactly this thing here was a main subject of the strategy dsraider was working on - because this cancelation should also happen intrabar and not only if valid at barclose.
have a loot at the thread here :

i dont know how it ended but this was a main problem / challenge in the beginning.

max-td
Reply With Quote
  #5 (permalink)
 
spinnybobo's Avatar
 spinnybobo 
Crete, IL/USA
 
Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61

Hi Mike

yes, you are the one who told me the difference of ATM strategies and backtesting ones. so you are not doing custom programming anymore? I know I took forever to start that project back in Feb and just ended up getting busy with school---sorry I was not able to hire you back then. you did some good programming for me before. Too bad I cannot hire you now to do this code for me.

I am basically just starting out with C#. I have taken some programming classes, so I understand the basics and object oriented concepts with C++ and some java, but just on a basic level.

yeah, basically I only have about the first 2 hours of the day to trade. I am using the EOT pro room and using their Ncep method. so learning a lot in a condensed period of time. then, doing a journal to track prograss later in day while at school.

It is intersting, and does require some tweaking. so, I did at least figure out how to put in the limit orders with my strategy that uses their system, I want to forward test using the ATM and cancel the limit order if it goes to far away from the set limit price.

from the sound of this, it sounds like this is pretty complex. I would not worry about it if I was able to sit in front of my computer all day like I used to.

plus, I can also test lots of other markets eventually through using several virutal machines all forward testing different settings and markets, etc..

Once I get better with coding, or maybe I can pay somebody, I can also get a strategy management code rather than the ATM so I can backtest over a period of several years using either IQ or esignal continuous.

so, that is where my thoughts are. if you are not custom programming anymore, can you recommend somebody?
thanks
Spencer

Follow me on Twitter Started this thread Reply With Quote
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,440 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,599

Sorry, I don't do this work anymore. And I don't have anyone to recommend any longer as well. Hopefully someone will step forward on the forum and you can work with them.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
 
COTtrader's Avatar
 COTtrader 
JACKSON, MICHIGAN
Legendary Market Wizard
 
Experience: Intermediate
Platform: TS and Trading View
Broker: TS
Trading: ES Awesome!
Posts: 955 since Jul 2009
Thanks Given: 406
Thanks Received: 648

Contact "Roonius" on this forum and at his site, TradingStudies.com.


Big Mike View Post
Sorry, I don't do this work anymore. And I don't have anyone to recommend any longer as well. Hopefully someone will step forward on the forum and you can work with them.

Mike


Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on June 12, 2010


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts