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


PriceActionSwing discussion
Updated: Views / Replies:468,714 / 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

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

Tks. Will work on this and send you feedback
Marcelo




forrestang View Post
Here you go!

I created pretty much a blank template that pulls the variables from Dorsch's Indicator. The two main one's I'm sure you need are there. You just need to add your logic which can just be 'IF' statements etc. The user inputs are coded for you already so that when you add it to a chart, you can manipulate the settings you want for the "PriceActionSwing" indicator itself. The picture should cover most of the explanation you need.

You can see the debug line in the code(green box in attached pic). This is how you can test to be sure it does what you want. For example, replace the "1" with a "-1" and you should see it will draw those arrows when the Trend is DOWN according to the "PriceActionSwing" indicator. If you replace "swingTrend" with "swingRelation" you will see it will draw the arrows only when price makes a HH/HL combination.

I'd suggest you add the "PriceActionSwing" indicator as well to your chart (with the same settings) while you test it to verify your logic is what you want. Play with it you will understand.

Only thing is that I made this as an indicator. You can get your logic straight here. Then once you do that, just turn it into a strategy, and put in the lggic for entering and exiting trades.


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


marcelo_s View Post
Tks. Will work on this and send you feedback
Marcelo

Hi, could not converted to Strategy. I attached the file so you can see. On Log Tab the error " Reference to an object ..... "
Tks for more help

Marcelo

Attached Files
Register to download File Type: cs SwingTrendX.cs (4.8 KB, 30 views)
Reply With Quote
 
  #313 (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


I'm not on a PC that has NT on it at the moment.

What did you do exactly to change it to a strategy?

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


forrestang View Post
I'm not on a PC that has NT on it at the moment.

What did you do exactly to change it to a strategy?

1- Added on Using Declaration using PriceActionSwing.Utility;
2- Added on Variables
private int swingSize = 2;
private SwingTypes swingType = SwingTypes.Standard;
private int dtbStrength = 15;
private IDataSeries swingRelation = null; //HH/HL or LL/LH
private IDataSeries swingTrend = null; //Trend defined by DTs/DBs too

//variables below not needed, let in for completeness
private bool seeRelation = false;
private bool useOldTrend = true;
private bool paintBars = true;
private int oldTrend = 0;
3- Added Conditions


protected override void OnBarUpdate()
{

if (CurrentBar < 1)
{
if (swingRelation == null)
swingRelation = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingRelation;

if (swingTrend == null)
swingTrend = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingTrend;
}

4- Added on Propierties the Parameters

#region Parameters
//=====================================================================
/// <summary>
/// Represents the swing size. e.g. 1 = small swings and 5 = bigger swings.
/// </summary>
#if NT7
[GridCategory("Parameters")]
#else
[Category("Parameters")]
#endif
[Description("Represents the swing size. e.g. 1 = small swings and 5 = bigger swings.")]
[Gui.Design.DisplayName("2.Swing size")]
public int SwingSize
{
get { return swingSize; }
set { swingSize = Math.Max(1, value); }
}
/// <summary>
/// Represents the swing type. Standard | Gann
/// </summary>
#if NT7
[GridCategory("Parameters")]
#else
[Category("Parameters")]
#endif
[Description("Represents the swing type. Standard | Gann")]
[Gui.Design.DisplayName("3.Swing type")]
public SwingTypes SwingType
{
get { return swingType; }
set { swingType = value; }
}
/// <summary>
/// Represents the double top/-bottom strength.
/// </summary>
#if NT7
[GridCategory("Parameters")]
#else
[Category("Parameters")]
#endif
[Description("Represents the double top/-bottom strength. Increase the value to get more DB/DT.")]
[Gui.Design.DisplayName("1.Double top/-bottom strength")]
public int DtbStrength
{
get { return dtbStrength; }
set { dtbStrength = Math.Max(1, value); }
}
[Category("Visualize")]
[Description("Indicates if the trend direction is shown or the swing relation.")]
[Gui.Design.DisplayNameAttribute("See swing relation")]
public bool SeeRelation
{
get { return seeRelation; }
set { seeRelation = value; }
}
[Category("Visualize")]
[Description("Indicates if the trend direction is changed when the old trend ends or whether a new trend must start.")]
[Gui.Design.DisplayNameAttribute("Trend change")]
public bool UseOldTrend
{
get { return useOldTrend; }
set { useOldTrend = value; }
}
#endregion


Compile OK but when adding to chart and enable, it does not works and error shows

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

Change the indicator type in the name of the strategy. Right now it probably says:

 
Code
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Indicator
Change it to:
 
Code
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
Also make sure your 'using declaration' block has it in there. Compare against another strategy you have loaded to make sure the proper declaration is there at the very top.

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


forrestang View Post
Change the indicator type in the name of the strategy. Right now it probably says:

 
Code
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Indicator
Change it to:
 
Code
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
Also make sure your 'using declaration' block has it in there. Compare against another strategy you have loaded to make sure the proper declaration is there at the very top.

******************************************************************************

That is what I did, see below

#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 SwingTrendX : Strategy
{
#region Variables
//Variables for PriceActionSwing
private int swingSize = 2;
private SwingTypes swingType = SwingTypes.Standard;
private int dtbStrength = 15;
private IDataSeries swingRelation = null; //HH/HL or LL/LH
private IDataSeries swingTrend = null; //Trend defined by DTs/DBs too

//variables below not needed, let in for completeness
private bool seeRelation = false;
private bool useOldTrend = true;
private bool paintBars = true;
private int oldTrend = 0;
#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()
{
CalculateOnBarClose = true;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{

if (CurrentBar < 1)
{
if (swingRelation == null)
swingRelation = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingRelation;

if (swingTrend == null)
swingTrend = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingTrend;
}

//MARCELO ----- This IF statement is just used for debugging, so that you can see what values are
//in the two main variables you want that are referenced above.
if(swingTrend[0] == 1)
{
DrawArrowUp("arrow"+CurrentBar, true, 0, Low[0]-12*TickSize, Color.Green);
}


if(swingTrend[0] == -1)
{
DrawArrowDown("arrow"+CurrentBar, true, 0, High[0]+12*TickSize, Color.Red);
}





}
#region Properties

#region Parameters
//=====================================================================
/// <summary>
/// Represents the swing size. e.g. 1 = small swings and 5 = bigger swings.
/// </summary>
#if NT7
[GridCategory("Parameters")]
#else
[Category("Parameters")]
#endif
[Description("Represents the swing size. e.g. 1 = small swings and 5 = bigger swings.")]
[Gui.Design.DisplayName("2.Swing size")]
public int SwingSize
{
get { return swingSize; }
set { swingSize = Math.Max(1, value); }
}
/// <summary>
/// Represents the swing type. Standard | Gann
/// </summary>
#if NT7
[GridCategory("Parameters")]
#else
[Category("Parameters")]
#endif
[Description("Represents the swing type. Standard | Gann")]
[Gui.Design.DisplayName("3.Swing type")]
public SwingTypes SwingType
{
get { return swingType; }
set { swingType = value; }
}
/// <summary>
/// Represents the double top/-bottom strength.
/// </summary>
#if NT7
[GridCategory("Parameters")]
#else
[Category("Parameters")]
#endif
[Description("Represents the double top/-bottom strength. Increase the value to get more DB/DT.")]
[Gui.Design.DisplayName("1.Double top/-bottom strength")]
public int DtbStrength
{
get { return dtbStrength; }
set { dtbStrength = Math.Max(1, value); }
}
[Category("Visualize")]
[Description("Indicates if the trend direction is shown or the swing relation.")]
[Gui.Design.DisplayNameAttribute("See swing relation")]
public bool SeeRelation
{
get { return seeRelation; }
set { seeRelation = value; }
}
[Category("Visualize")]
[Description("Indicates if the trend direction is changed when the old trend ends or whether a new trend must start.")]
[Gui.Design.DisplayNameAttribute("Trend change")]
public bool UseOldTrend
{
get { return useOldTrend; }
set { useOldTrend = value; }
}
#endregion



#endregion
}
}

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

I just tried running it.

There is a problem somewhere, definetely some reference somewhere. I'm not sure where at the moment.

I'll play around with it, not sure why the strategy is giving problems when the indie is not. You may want to start a thread in programming.

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


forrestang View Post
I just tried running it.

There is a problem somewhere, definetely some reference somewhere. I'm not sure where at the moment.

I'll play around with it, not sure why the strategy is giving problems when the indie is not. You may want to start a thread in programming.

Tks, let me know if you can solve it.
I will post it on programming also to ask for help

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


marcelo_s View Post
Tks, let me know if you can solve it.
I will post it on programming also to ask for help

I asked support to NT, and they answered as follow

" The issue likely is that indicator and strategies work different with your assignment of the data series return of the SwingRelation indicator as an object.
I would suggest working with the supported .Set approach here to add doubles to a series. You can likely just call the indicator plot directly in the strategy without needed to create additional series here first. "

Do you know how to do what is suggested ?

tks for help

Reply With Quote
 
  #320 (permalink)
Elite Member
Germany
 
Futures Experience: Intermediate
Platform: NinjaTrader
 
Serninja's Avatar
 
Posts: 56 since Mar 2010
Thanks: 87 given, 30 received

PriceActionSwing - Relative Swing Volume in Percent


dorschden,

I would like to ask you if it's possible for you to add a relative volume swing value in percent?

For example: Imagine a down swing in price with 100K volume and then a 30% up swing in price with 50K volume. When I set to show me the swing percentage, I can see the 30% print which is referring to the price swing but I still have to make mental math regarding the relative volume swing in percent of the last swing which would be 50%.

In this case price retraced 30% up but needed 50% of the last swing volume.

I believe it's helpful to have an 'at a glance - effort vs. result' view, so one can see if the price move is accompanied with high or low volume relative to the last price swing.

Thank you very much in advance!

Kind regards,
Serninja

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 05:51 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.10 seconds with 19 queries on phoenix via your IP 54.167.44.32