Sample Advanced Automated Strategy v1.0 - NinjaTrader Programming | futures io social day trading
futures io futures trading


Sample Advanced Automated Strategy v1.0
Updated: Views / Replies:28,272 / 117
Created: by dsraider Attachments:15

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
 15  
 
Thread Tools Search this Thread
 

Sample Advanced Automated Strategy v1.0

  #41 (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

Good luck and goodnight,

Dave

Reply With Quote
 
  #42 (permalink)
 Vendor: www.ezcolortrading.com 
Cambridge, Ontario
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Zen-Fire
Favorite Futures: 6E
 
Posts: 1,773 since Dec 2009
Thanks: 1,258 given, 1,196 received

Hi Dave

With your best wishes, my 3 computers (I borrowed one from my hubby) have been working very diligently this morning.

1. One is running 4 strategies (3 YM and 1 ES) with trail.

i. ES is the only one that seems normal and no looping trades. It did 2 trades and both marginally profitable. It does have CalculateOnBarClose @false.

ii. 2 YM ones @false and one @true. All chopped a nice short ride into numerous trades. The 2 @false ones chopped it into 8 while the @true one made it into 4.

Well, I have no clue what's going on. Oh, even one of the 3 YM charts looked different from the other two. I may have overloaded my computer LOL!

2. One was running 2 strategies on ES and YM until 12:00 noon before Ninja got frozen and I had to close it .. sigh ..

3. With one I was doing Market Replay on the strategies with trail on early March data. Looping trades again and the worst one so far chopped a nice trade into 20 trades - gosh!

I will need to research more on how to have a trail code that will not cause choppy trades. Plus I will review my strategies again to locate any coding issues that may have caused it and not the trail code.

Dave, I am very grateful for your assistance. Will knock at your door when I need your advice. Thank you!!!!!

Beth

Reply With Quote
 
  #43 (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


Geeze...

Just so I know, this is WITH FirstTickOrBar and [1] in the exits as well as the entries?

Reply With Quote
 
  #44 (permalink)
 Vendor: www.ezcolortrading.com 
Cambridge, Ontario
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Zen-Fire
Favorite Futures: 6E
 
Posts: 1,773 since Dec 2009
Thanks: 1,258 given, 1,196 received

Yes Dave. Newbie me followed your kind suggestion to the dot!

Reply With Quote
 
  #45 (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

Hmm...then I'm afraid I'm out of ideas. There's obviously a conflict in the code but I'm truly no expert. With any luck, someone will download yours, as it's very good, and find it. So, I'll keep my fingers crossed for you.

D

Reply With Quote
 
  #46 (permalink)
 Vendor: www.ezcolortrading.com 
Cambridge, Ontario
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Zen-Fire
Favorite Futures: 6E
 
Posts: 1,773 since Dec 2009
Thanks: 1,258 given, 1,196 received

.. knock .. knock .. Dave, need to pick your brains please (for my learning purpose).

For ES, I have the following:

 
Code
privateint breakEvenTicks = 4;
privateint plusBreakEven = 0;
privateint trailProfitTrigger = 4;
privateint trailStepTicks = 1;
 
privatedouble initialBreakEven = 0;
privatedouble previousPrice = 0;
privatedouble newPrice = 0; 

privateint stoplossticks = 10;
 
case MarketPosition.Long:
// Once the price is greater than entry price+ breakEvenTicks ticks, set stop loss to breakeven
if (Close[0] == Position.AvgPrice + breakEvenTicks * TickSize && previousPrice == 0)
{
initialBreakEven = Position.AvgPrice + plusBreakEven * TickSize;
debug ("Moving stop up to "+Position.AvgPrice);
SetStopLoss(longEntryID, CalculationMode.Price, initialBreakEven, false);
previousPrice = Position.AvgPrice;
PlaySound(@"C:\Program Files\NinjaTrader 6.5\sounds\AutoTrail.wav");
PrintWithTimeStamp("previousPrice = "+previousPrice);
PrintWithTimeStamp("newPrice = "+previousPrice);
}
// Once at breakeven wait till trailProfitTrigger is reached before advancing stoploss by trailStepTicks size step
elseif (previousPrice != 0////StopLoss is at breakeven
&& Close[0] > previousPrice + trailProfitTrigger * TickSize)
 
{
newPrice = previousPrice + trailStepTicks * TickSize;
SetStopLoss(longEntryID, CalculationMode.Price, newPrice, false);
previousPrice = newPrice;
//print the previous price before it's changed
PrintWithTimeStamp("previousPrice = "+previousPrice);
PrintWithTimeStamp("newPrice = "+previousPrice);
PlaySound(@"C:\Program Files\NinjaTrader 6.5\sounds\AutoTrail.wav");
}
break;
For the enclosed chart, there's a long @1039. It went up to 1041 yet the trade was closed @1039.25 (a SL order). My understanding on the above code is SL to BE after a 4-tick move. Then SL will be adjusted 1 tick continuously as the trade is working before getting stopped out.


Instead, the trade was closed early (in my mind) and the system re-entered again at 1041!? If the trail code was working, shouldn't the trade be closed around 1040 and there would not be a re-entry?

Please help fixing my understanding! Thank you.

Beth

Attached Thumbnails
Sample Advanced Automated Strategy v1.0-es-06-10-3_11_2010-medianrenko-4-ticks-.jpg  

Last edited by wgreenie; March 11th, 2010 at 03:23 PM. Reason: Make it easier to understand.
Reply With Quote
 
  #47 (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

Your understanding is right on. That's exactly what it should have done. Did you have more than one position open at the time? Also, the reentry shouldn't have anything to do with the trail, but with your entry. Did you add FirstTickOfBar and set everything back a bar on this one too? I couldn't tell if you added this strat to each instrument or created different ones for each.

Reply With Quote
 
  #48 (permalink)
 Vendor: www.ezcolortrading.com 
Cambridge, Ontario
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Zen-Fire
Favorite Futures: 6E
 
Posts: 1,773 since Dec 2009
Thanks: 1,258 given, 1,196 received

Great to learn that my understanding is right on even it's not doing what it's supposed to do.

Yes, the strategy has FirstTickOfBar and I've set everything back a bar on both entry and exit conditions. My strategy only allows one trade (one open position) at a time and no multiple-trades.

I checked the long trade in question and its closing was not triggered by one or both of the exit conditions. Sooo, it's another mystery ooo .. I may soon be a collector of mysteries .. haha ..

Thanks again Dave!

Beth

Reply With Quote
 
  #49 (permalink)
Just starting out...
toronto,ontario
 
Futures Experience: Advanced
Platform: ninja trader
Broker/Data: mirus
Favorite Futures: ES,NQ
 
Posts: 15 since Nov 2009
Thanks: 6 given, 33 received

hi , i downloaded the strategy and inported the file with success, i am connected and charttrader is disabled but still my strategy icon is diabled same thing when i click right on chart ,strategy is greyed out .am i doing something wrong. thanks for the help

thaks

Reply With Quote
 
  #50 (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


stockdisk,

Are you using the free version of NT? If so, it doesn't allow for strategies.

Reply With Quote

Reply



futures io > > > > > Sample Advanced Automated Strategy v1.0

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
VIDEO TUTORIAL: How to create an advanced MultiCharts EasyLanguage Strategy Big Mike MultiCharts 39 November 9th, 2017 04:35 AM
VIDEO TUTORIAL: How to create an advanced NinjaTrader Strategy Big Mike NinjaTrader 63 November 6th, 2016 03:25 PM
End of day sample strategy mrticks The Elite Circle 9 February 18th, 2011 07:37 AM
VIDEO TUTORIAL: How to create an advanced NinjaTrader Strategy Big Mike NinjaTrader Programming 0 January 26th, 2010 06:22 AM
Advanced Strategy Writing zeller4 NinjaTrader Programming 8 December 28th, 2009 12:21 AM


All times are GMT -4. The time now is 09:58 PM.

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-12 in 0.13 seconds with 20 queries on phoenix via your IP 54.221.93.187