ATM Template? - NinjaTrader Programming | futures io social day trading
futures io futures trading


ATM Template?
Updated: Views / Replies:3,455 / 12
Created: by dsraider Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 1  
 
Thread Tools Search this Thread
 

ATM Template?

  #1 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

ATM Template?

Hey All,

I'm in the process of writing a fully automated strategy that will do the following:

1. enter limit orders (long/short) for two cars (ES) when my signal criteria is met
2. will cancel the limit orders automatically should price gap 4 ticks away before filling
3. if filled, will set initial stops and two different targets (for scaling out)
4. moves both stops to breakeven at +4 ticks in profit (my first target - using B/E because my targets never sell at first touch)
5. moves stop up on 2nd car (after first is filled) tick by tick, like a trail
6. only trades from 10:15 AM to 3:15 PM (EST)
7. will only enter one trade at a time, even though strat is working on several timeframes
8. will shut down if daily loss is X dollars
9. will email me details (direction, entry price, target/stop fills & prices)

I've already coded and tested most of this but when I went to change market orders to limit, it simply stopped working. I'm sure I'm not the only one who wants to do this so I was wondering if anyone knew of a sort of glorified ATM strat template that has all or most of this laid out, so people can simply enter their own parameters. I've practically tattooed ninja's forum to my brain and have installed more sample strats than I can count. They've helped tremendously but I find them to be incomplete.

Anyway, thanks for reading through both hours of my post
Dave

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received


hi dsraider ,

first step would be : post what you have coded + tried yet !
so we do not run into the same issues / direction you had yet.

max-td

Last edited by max-td; February 3rd, 2010 at 04:04 AM.
Reply With Quote
 
  #4 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

Sir, I cannot argue with you when you use logic against me! Apologies, but my brain is currently fried.

As you can see in the code, I will be adding the 20k and 30k charts to be covered by this strat using BarsInProgress (initial chart will be the 10k). I only have the Add() lines in right now. This is just to make sure it works on one first. You will need BigMike's DoubleMA in order to run. I'll add to my signal later but this will do for now. It usually works fine but sometimes the order self-cancels upon entry, saying I've set my stop as much as nine points in the opposite direction. Be on the lookout and good luck. Any help you can give, especially with respect to the placing of limit orders and the CancelOrder() criteria I described would be of great help.

Thanks,
Dave

UPDATE: Fixed a bug - SetStopLoss for shorts were both set to "Short 1a". Changed the second to 1b and it now works as it should. Currently working on changing these from market to limit orders. Will report back. NOTE: You will have to change "a" to "b" on your own right now as I am currently in a state of uncompiled madness...

Attached Files
Register to download File Type: zip DoubleMAStrat.zip (39.1 KB, 87 views)

Last edited by dsraider; February 3rd, 2010 at 08:38 PM.
Reply With Quote
The following 3 users say Thank You to dsraider for this post:
 
  #5 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

hey you,
glad to hear you found the error!
i had a short look into the strat but wasnt able to go through with enaugh concentration/time the last days.

changing STOPS from market to limit orders - i think thats a tricky thing.
its high riks depending on the market you trade -- if it runs through without a fill you get in BIG troubles ! i would not recomment this!
if you wanna go out - go OUT - and dont risk to get no fill!

and i also believe that its not possible at every exchange - it isnt accepted from all exchanges. but i dont have exact infos about this.
maybe someone else can comment this.

max-td
Reply With Quote
 
  #6 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

Oh, I hear you loud and clear. That's why I'm currently trying to get CancelOrder() to kick in after X number of ticks, should my limit order not fill. I suggested to one of the ninjatrader forum guys (to whom I will soon owe my life) that they create an advanced wizard to deal with things like this. In the meantime, once I get this thing complete (still have a few things to add) I'll post it here as a template so people can just grab it and plug in their signals/parameters.

One thing, though. I'm not changing my stops to limit orders (I'm crazy but I'm not that crazy). I'm changing the entry market orders to limit orders (hence the CancelOrder() language). For the stops, I'm setting an initial stop, then turning it into a trailing stop. That part actually works. I'm not really sure how but I just keep drinking until everything complies

Reply With Quote
 
  #7 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received


dsraider View Post
In the meantime, once I get this thing complete (still have a few things to add) I'll post it here as a template so people can just grab it and plug in their signals/parameters.

Great idea ! - Thats the way the place works here.


Let me think - once i created smoething like this "cancel if the price runs away without a fill"-stuff ....

i created a double on the Bars high / Low together with the signal-trigger-Bar and then i usesed the cancel-function if the price ran more then this double + X ticks .
but i had to wait for a Barclose to use the bar-high for messuring this.
its not easy to do this intrabar.

so if you where using very small timeframes - that may work for you.
if you use bigger timeframes and the target-vakue is reached long before you have a new barclose - its a probleme - we had a discusion about this somewhere these days.

One solution is to run a multitimeframe-strategy and implant a 1 Range-timeframe.
that gives you the possibility to grab a usable bar-High-value for your messuring-double every new tick higher so to say.

hehe - hope this it understandable - its still early morning here

cu later


max-td
Reply With Quote
The following user says Thank You to max-td for this post:
 
  #8 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

That would help explain my current battle with the intrabar CancelOrder() language. The weird thing is 'Close[0]' actually works perfectly for current price in the trail part so I'm about to test 'if(Close[0] >= Close[1] + X * TickSize)' where Close[1] is the close of the previous bar (my current entry price). Strange, but if it works, it works. The NT Forum guys said it will work. We shall soon see.

Great tip about the range. I NEVER would have thought of that so thanks for the tip.

It's 5:22 AM here so you're the one that needs luck understanding me

Dave

Reply With Quote
 
  #9 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

max-td,

In case you (or anyone else) were curious, if(Close[0] >= Close[1] + X * TickSize did NOT work. Nor did anything else I tried today. I hear you on the Range addition but I was hoping to avoid that. So, if you (or anyone else) knows how to cancel an unfilled limit order once it's X number of ticks away intrabar, I will clean your house! Once that's done, I can post this thing.

Later,
Dave

Reply With Quote
 
  #10 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received


well - i think that you have basicly to decide if you run your strat

- calc on bar close - true
OR
- - calc on bar close - false (every-tick--calc)

so you can NOT have both together like ENTRY-Trigger on Bar-close-conditions
and
cancel-trigger as intrabar-calculation.

Thats the point i think.

To our Strat-coders -> please correct me if there are other soutions ! Thanks

max-td
Reply With Quote

Reply



futures io > > > > > ATM Template?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
ninja template files - how to use them ? milburnperry NinjaTrader 3 December 27th, 2014 07:09 PM
Jeffs Template Jeff Castille The Elite Circle 15 September 17th, 2012 05:56 PM
Template Title On Chart zt379 NinjaTrader 4 March 2nd, 2011 10:40 PM
Need Help with Journal Template grego Elite Trading Journals 2 August 14th, 2010 03:52 AM
AR01 Template(s) AR01 The Elite Circle 7 April 19th, 2010 11:43 AM


All times are GMT -4. The time now is 04:26 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-17 in 0.13 seconds with 20 queries on phoenix via your IP 54.227.51.103