PriceActionSwing discussion - NinjaTrader | futures io social day trading
futures io futures trading


PriceActionSwing discussion
Updated: Views / Replies:468,758 / 1,551
Created: by dorschden Attachments:491

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

PriceActionSwing discussion

  #291 (permalink)
Elite Member
Germany (Meck-Pomm)
 
Futures Experience: Advanced
Platform: NinjaTrader
 
Posts: 110 since Jun 2009
Thanks: 54 given, 994 received

PriceActionSwing DataSeries access

Use the following code, which is a good way to access the public DataSeries from the PriceActionSwing indicator within other indicators/strategies.
 
Code
                            
#region Using declarations

...
using PriceActionSwing.Utility;
#endregion

#region Variables
...
private 
int dtbStrength 15;
private 
int swingSize 7;
private 
SwingTypes swingType SwingTypes.Standard;
private 
IDataSeries swingRelation;
private 
IDataSeries swingTrend;
#endregion

protected override void OnStartUp()
{
  if (
swingRelation == null)
    
swingRelation PriceActionSwing(InputdtbStrengthswingSizeswingType).SwingRelation;
  if (
swingTrend == null)
    
swingTrend PriceActionSwing(InputdtbStrengthswingSizeswingType).SwingTrend;
  
// Assign other DataSeries here
}

protected 
override void OnBarUpdate()
{
  
// If HH and HL draw an arrow
  
if (swingRelation[0] == 1)
    
DrawArrowUp("MyArrow" CurrentBartrue0Low[0] - TickSizeColor.Lime);
  ...

Forrestang,

Like futuretrader mention, it is important, that the assignment of the "SwingRelation" dataseries comes before any other return statement, while the "if (CurrentBar < 1)" part is a leftover from NT 6.5. Or you can use the above code and every thing should work. You can do the same with the data series from the IchiCloud indicator.

Reply With Quote
The following 4 users say Thank You to dorschden for this post:
 
  #292 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received

@dorschden

Thanks a bunch! My script is working with the changes you mentioned.

I am trying to get my indicator to display in MA (Market Analyzer) now. My signal is basically in 1 of 3 positions.

I have been staring at the template you provided in the thread while I was going through it for YOUR MA, trying to figure out which variables you have exposed and how you did it. But I can't get it to do what I want.

What's weirder, is that as you can see in that column "WT_Up" on my MA template, it has the closing price. Which isn't what I want there.

What is it that I need to make sure my script has so that I can print it to MA? I can change the cell conditions, but where does it look in my script for that information?

-----EDIT------

I created a new data series called "trendState." Each time I perform my calculations (which have 3 different states), I have been putting a 1,0, -1 into that data series on each bar. I tried to then expose this variable.

Now, it shows up in MA as a selectable option in the 'plot' field. But the output is still just the close of the last bar on my chart, instead of the output of that dataSeries.

Here is what I mean by what I added. And it is in fact printing the proper output to my test window. I just haven't gotten it to work properly with MA.

 
Code
if (swingTrend[0] == 1 && blueCloud == true && Low[0] > spanA-ichiBuffer*TickSize)
			{
				UpTrend.Set(1);
				trendState[0] = 1;
			}
            
			else if (swingTrend[0] == -1 && redCloud == true && High[0] < spanA+ichiBuffer*TickSize)
			{
				DownTrend.Set(1);
				trendState[0] = -1;
			}
			
			else
			{
				NoWhere.Set(1);	
				trendState[0] = 0;
			}
			
			Print(trendState[0]);

Attached Thumbnails
PriceActionSwing discussion-prime2011-07-17_093014.jpg  

Last edited by forrestang; July 17th, 2011 at 12:27 PM.
Reply With Quote
 
  #293 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received


@dorschden

I'm such a newb!!! I finally got it working.

It was the way I was defining that new data series in the 'properties' section. I now have it returning the data series instead of whatever it was before.

Glad I had your script to reference.

Thanks again Dorschden!

Attached Thumbnails
PriceActionSwing discussion-finally.jpg  
Reply With Quote
 
  #294 (permalink)
Trading Apprentice
NED
 
Futures Experience: None
Platform: Ninja
 
Posts: 34 since May 2010
Thanks: 7 given, 8 received

With these numbers you can get swingrelation:
-2 = DT
-1 = LL and LH
0 = price is nowhere
1 = HH and HL
2 = DB

But is it also possible to get HL and LH?

Reply With Quote
 
  #295 (permalink)
Elite Member
London UK
 
Futures Experience: Advanced
Platform: NinjaTrader, TT
Broker/Data: Mirus
Favorite Futures: CL, Dax, ES, Eurostoxx50
 
Posts: 121 since Oct 2010
Thanks: 23 given, 46 received

Market analyser

Hi Dorschden,

Thanks again for this fantastic work on PAS.
Just a question please : is it possible to have sound alerts with the market analyser template you did? If yes, how do you set it up?

Thanks a lot for your help.

Raphael

Reply With Quote
 
  #296 (permalink)
Elite Member
PA
 
Futures Experience: Beginner
Platform: Sierra, Ninja, MD
Broker/Data: Optimus/Rithmic & IQ
Favorite Futures: currency futures
 
Posts: 27 since Apr 2011
Thanks: 10 given, 19 received

Does anyone have the time and skill to add an email alert in addition to the sound?

Reply With Quote
 
  #297 (permalink)
Elite Member
Germany (Meck-Pomm)
 
Futures Experience: Advanced
Platform: NinjaTrader
 
Posts: 110 since Jun 2009
Thanks: 54 given, 994 received


no111 View Post
...you can get swingrelation... But is it also possible to get HL and LH?

no111,

This isn't possible but you can add a dataseries and calculate it by yourself. Add this code to the indicator.
 
Code
                            
#region Variables

private DataSeries swingHlLh;
#endregion

// Add to the Initialize() method
swingHlLh = new DataSeries(this);

// Add in the end of OnBarUpdate() method
// HL and LH
if (curHighRelation == Relation.Lower && curLowRelation == Relation.Higher
  
swingHlLh.Set(1);
else
  
swingHlLh.Set(0);

#region Properties
[Browsable(false)]
public 
DataSeries SwingHlLh
{
  
get { return swingHlLh; }
}
#endregion 

rdaune View Post
is it possible to have sound alerts with the market analyser template you did?

Raphael,

Yes, this is possible. Just add an alert condition to it. For more details look here.


evancds View Post
Does anyone have the time and skill to add an email alert in addition to the sound?

evancds,

Sorry I can't help you here, I don't have time for this. But on this site are enough scripts with an email alert, just copy and paste the code.

Reply With Quote
The following 4 users say Thank You to dorschden for this post:
 
  #298 (permalink)
Elite Member
PA
 
Futures Experience: Beginner
Platform: Sierra, Ninja, MD
Broker/Data: Optimus/Rithmic & IQ
Favorite Futures: currency futures
 
Posts: 27 since Apr 2011
Thanks: 10 given, 19 received

Email

Ok, I've attempted to add the email alert. Can some one compile this and see if it works? I don't have the full version of Ninjatrader

Attached Files
Register to download File Type: cs PriceActionSwingEmail.cs (190.5 KB, 45 views)
Reply With Quote
 
  #299 (permalink)
Urban Samurai
Chicago IL
 
Futures Experience: Intermediate
Platform: Ninja, MT4,TOS, SC, Matlab
Broker/Data: CQG, AMP, MB, DTN
Favorite Futures: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,039 since Jun 2010
Thanks: 226 given, 688 received


evancds View Post
Ok, I've attempted to add the email alert. Can some one compile this and see if it works? I don't have the full version of Ninjatrader

I think you can always put your SIM key back in NT, restart, so that you can mess with scripting if you wish.

Reply With Quote
 
  #300 (permalink)
Elite Member
BUENOS AIRES
 
Futures Experience: Intermediate
Platform: ninja
Broker/Data: AMP
Favorite Futures: ES
 
Posts: 34 since Nov 2009
Thanks: 0 given, 13 received

PriceAction Swing Trend


Hi,
I am trying to use the code to build a strategy but an error on the Log tab comes up showing " Reference to oject .... )

This is the way I am starting to write code. May be you can help me how to use this indicator correctly

#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
using PriceActionSwing.Utility;
#endregion

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Enter the description of your strategy here")]
public class CLSwing : Strategy
{
#region Variables
// Wizard generated variables

private int swingSize = 3;
private SwingTypes swingType = SwingTypes.Standard;
private int dtbStrength = 15;
private IDataSeries swingTrend;
private IDataSeries swingRelation;

// User defined variables (add any user defined variables below)
#endregion

/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
// SetStopLoss("", CalculationMode.Ticks, SaftyStopLoss, false);
//SetProfitTarget("", CalculationMode.Ticks, Profit);
//SetTrailStop("", CalculationMode.Ticks, Stop, false);
// SetStopLoss("", CalculationMode.Ticks, Stop, false);

CalculateOnBarClose = true;

}


/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (CurrentBar < 1)
{
if (swingTrend == null)
swingTrend = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingTrend;
if (swingRelation == null)
swingRelation = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingRelation;
}
int trend = Convert.ToInt32(swingTrend[0]);
switch (trend)
{
case -1:
// Down trend - do something
EnterShort(DefaultQuantity, "Sh");
break;
case 1:
// Up trend - do something
EnterLong(DefaultQuantity, "Lg");
break;
default:
// No trend - do something or nothing
break;
}

// Or alternative
//if (swingRelatioin[0] == 2)
// Double bottom - do something
}
#region Properties

#endregion
}
}

Reply With Quote

Reply



futures io > > > > PriceActionSwing discussion

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
Murray Math Discussion? jwhtrades Traders Hideout 5 July 27th, 2011 10:06 PM
Looking for general discussion thread. jctrader Traders Hideout 2 May 2nd, 2011 03:23 PM
PriceActionSwing jeff92887 NinjaTrader 2 March 1st, 2011 07:15 AM


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