Code Snippets needed! - NinjaTrader Programming | futures io social day trading
futures io futures trading


Code Snippets needed!
Updated: Views / Replies:3,428 / 11
Created: by zeller4 Attachments:0

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

Code Snippets needed!

  #11 (permalink)
Elite Member
Durham, NC
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: No Idea
 
Posts: 7 since Jul 2010
Thanks: 6 given, 8 received

Entry room against a Pivot Point

Hey, I think this is a great idea. I have some code lying around of things I've tried out that may or may not be useful to others so I'll try to add it here.

In Variables Section:
 
Code
private double pivotR3;
private double pivotR2;
private double pivotR1;
private double pivotPP;
private double pivotS1;
private double pivotS2;
private double pivotS3;
private double rLevel;
private double sLevel;
private double profitTarget = 8; # In ticks
In OnBarUpdate Section:

 
Code
if (Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).PP.ContainsValue(0))
{
pivotR3 = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).R3[0];
pivotR2 = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).R2[0];
pivotR1 = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).R1[0];
pivotPP = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).PP[0];
pivotS1 = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).S1[0];
pivotS2 = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).S2[0];
pivotS3 = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).S3[0];
}

// Find Closest Resistance
if (GetCurrentAsk() < pivotS3)
	rLevel = pivotS3;
else if (GetCurrentAsk() < pivotS2)
	rLevel = pivotS2;
else if (GetCurrentAsk() < pivotS1)
	rLevel = pivotS1;
else if (GetCurrentAsk() < pivotPP)
	rLevel = pivotPP;
else if (GetCurrentAsk() < pivotR1)
	rLevel = pivotR1;
else if (GetCurrentAsk() < pivotR2)
	rLevel = pivotR2;
else rLevel = pivotR3;
//Print("Resistance Level: " + rLevel + "     Current Price: " + GetCurrentAsk());

// Find Closest Support
if (GetCurrentBid() > pivotR3)
	sLevel = pivotR3;
else if (GetCurrentBid() > pivotR2)
	sLevel = pivotR2;
else if (GetCurrentBid() > pivotR1)
	sLevel = pivotR1;
else if (GetCurrentBid() > pivotPP)
	sLevel = pivotPP;
else if (GetCurrentBid() > pivotS1)
	sLevel = pivotS1;
else if (GetCurrentBid() > pivotS2)
	sLevel = pivotS2;
else sLevel = pivotS3;
//Print ("Support Level: " + sLevel + "     Current Price: " + GetCurrentBid());
In the entry decision code:

 
Code
if (rLevel - GetCurrentAsk() >  (profitTarget * TickSize) &&
       EMA(ME) == pure awesomeness)
{ enter Long }

Reply With Quote
The following 2 users say Thank You to slacker for this post:
 
  #12 (permalink)
Elite Member
Durham, NC
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: No Idea
 
Posts: 7 since Jul 2010
Thanks: 6 given, 8 received

Entry room against Murrey Math

Same as the Pivot Points but for Murrey Math:

 
Code
if (MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).P28.ContainsValue(0))
{
pivotPP28 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).PP28[0];
pivotPP18 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).PP18[0];
pivotP88 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).P88[0];
pivotP78 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).P78[0];
pivotP68 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).P68[0];
pivotP58 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).P58[0];
pivotP48 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).P48[0];
pivotP38 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).P38[0];
pivotP28 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).P28[0];
pivotP18 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).P18[0];
pivotN08 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).N08[0];
pivotN18 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).N18[0];
pivotN28 = MurreyMath(false, NinjaTrader.Data.PivotRange.Daily).N28[0];
}
// Find Closest Resistance
if (GetCurrentAsk() < pivotN28)
	rLevel = pivotN28;
else if (GetCurrentAsk() < pivotN18)
	rLevel = pivotN18;
else if (GetCurrentAsk() < pivotN08)
	rLevel = pivotN08;
else if (GetCurrentAsk() < pivotP18)
	rLevel = pivotP18;
else if (GetCurrentAsk() < pivotP28)
	rLevel = pivotP28;
else if (GetCurrentAsk() < pivotP38)
	rLevel = pivotP38;
else if (GetCurrentAsk() < pivotP48)
	rLevel = pivotP48;
else if (GetCurrentAsk() < pivotP58)
	rLevel = pivotP58;
else if (GetCurrentAsk() < pivotP68)
	rLevel = pivotP68;
else if (GetCurrentAsk() < pivotP78)
	rLevel = pivotP78;
else if (GetCurrentAsk() < pivotP88)
	rLevel = pivotP88;
else if (GetCurrentAsk() < pivotPP18)
	rLevel = pivotPP18;
else rLevel = pivotPP28;
//Print("Resistance Level: " + rLevel + "     Current Price: " + GetCurrentAsk());

// Find Closest Support
if (GetCurrentBid() > pivotPP28)
	sLevel = pivotPP28;
else if (GetCurrentBid() > pivotPP18)
	sLevel = pivotPP18;
else if (GetCurrentBid() > pivotP88)
	sLevel = pivotP88;
else if (GetCurrentBid() > pivotP78)
	sLevel = pivotP78;
else if (GetCurrentBid() > pivotP68)
	sLevel = pivotP68;
else if (GetCurrentBid() > pivotP58)
	sLevel = pivotP58;
else if (GetCurrentBid() > pivotP48)
	sLevel = pivotP48;
else if (GetCurrentBid() > pivotP38)
	sLevel = pivotP38;
else if (GetCurrentBid() > pivotP28)
	sLevel = pivotP28;
else if (GetCurrentBid() > pivotP18)
	sLevel = pivotP18;
else if (GetCurrentBid() > pivotN08)
	sLevel = pivotN08;
else if (GetCurrentBid() > pivotN18)
	sLevel = pivotN18;
else sLevel = pivotN28;
//Print ("Support Level: " + sLevel + "     Current Price: " + GetCurrentBid());

Reply With Quote
The following 2 users say Thank You to slacker for this post:

Reply



futures io > > > > > Code Snippets needed!

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
help needed red burns Traders Hideout 3 May 19th, 2011 10:38 PM
Turtle TS-code help needed from programmers abcplot EasyLanguage Programming 1 May 11th, 2011 03:29 PM
Just a little code assist needed for entry filter Trader.Jon NinjaTrader Programming 2 October 27th, 2010 02:25 PM
code snippets Saroj Feedback and Announcements 1 September 11th, 2009 02:10 PM


All times are GMT -4. The time now is 09:10 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-18 in 0.07 seconds with 19 queries on phoenix via your IP 107.20.115.174