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


PriceActionSwing discussion
Updated: Views / Replies:464,192 / 1,549
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

  #281 (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, 687 received


dorschden View Post
Pepperdog,

you have to add this lines in your strategy

 
Code
#region Using declarations
...
using PriceActionSwing.Utility;
#endregion 

#region Variables
...
private SwingMode pAS_SwingMode = SwingMode.Standard; 
private int pAS_DtbStrength = 15; 
private int pAS_Span = 8; 
#endregion

protected override void Initialize()
{
   …
   // Add the indicator to the chart - not necessary
   Add(PriceActionSwing(pAS_SwingMode, pAS_DtbStrength, pAS_Span));
}

protected override void OnBarUpdate()
{
   …
   // If the last high and  low was higher high and higher low and a short sma cross above the long sma enter long
   if (PriceActionSwing(pAS_SwingMode, pAS_DtbStrength, pAS_Span).PriceSwingRelation[0] == 1 && CrossAbove(SMA(3), SMA(7), 1))
   (
      EnterLong(DefaultQuantity, "");
   )
   ...
}

#region Properties
[Category("Parameters")]
public SwingMode PAS_SwingMode
{
   get { return pAS_SwingMode; }
   set { pAS_SwingMode = value; }
}

[Category("Parameters")]
public int PAS_DtbStrength
{
   get { return pAS_DtbStrength; }
   set { pAS_DtbStrength = Math.Max(1, value); }
}

[Category("Parameters")]
public int PAS_Span
{
   get { return pAS_Span; }
   set { pAS_Span = Math.Max(1, value); }
}
#endregion
For the 1 in "PriceSwingRelation[0] == 1" you can set the following values
-2 for double top
-1 for lower high and lower low
0 nothing
1 for higher high and higher low
2 for double bottom

Hope this helps.


Howdy.

I am trying to reference some things in your study. Basically just the swing relation, i.e. price making a HH and HL or LL and LH.

When I try to add this code snippet here, I get an error shown in the picture. I don't know if something has changed, but I am using the latest version from the download section. Is this still the proper code snippet to insert into my indicator?

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

You have to replace in your post in the bold line the "PriceSwingRelation" with "SwingRelation" and then it should work. You can also take a look in the PriceActionSwingTrend indicator as an example how to access the swing relation values.
 
Code
                            
// HH and HL

if (PriceActionSwing(pAS_DtbStrengthpAS_SpanpAS_SwingMode).SwingRelation[0] == 1)
// if (PriceActionSwing(15, 7, SwingTypes.Standard).SwingRelation[0] == 1)
{
  
// Do something



Last edited by dorschden; July 16th, 2011 at 06:26 PM.
Reply With Quote
The following user says Thank You to dorschden for this post:
 
  #283 (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, 687 received



dorschden View Post
You have to replace in your post in the bold line the "PriceSwingRelation" with "SwingRelation" and then it should work. You can also take a look in the PriceActionSwingTrend indicator as an example how to access the swing relation values.
 
Code
                            
// HH and HL
if (PriceActionSwing(pAS_SwingModepAS_DtbStrengthpAS_Span).SwingRelation[0] == 1)
{
  
// Do something


I just couldn't seem to get that to work no matter what I tried. I kept getting an error having to do with the 'swingmode.'

So I just copied that entire "PriceActionSwingTrend" and I will start from there by modifying that.

But can you tell me which data series, or variable I would need to use just to know when a HH/HL or LL/LH is being made?

Just basically,

 
Code
if (price makes a HH/HL)
{
    Do this
}


-----EDIT---------
Looks like "swingRelation" is what I need.


Last edited by forrestang; July 16th, 2011 at 06:27 PM.
Reply With Quote
 
  #284 (permalink)
Elite Member
Germany (Meck-Pomm)
 
Futures Experience: Advanced
Platform: NinjaTrader
 
Posts: 110 since Jun 2009
Thanks: 54 given, 993 received


forrestang View Post
I just couldn't seem to get that to work no matter what I tried. I kept getting an error having to do with the 'swingmode.'

The parameters were interchanged. Try the edited code above.
And in the "using" region in the top of your indicator/strategy you have to add "using PriceActionSwing.Utility;".
Check for the SwingRelation value.
SwingRelation[0] == 1 is equal to HH/HL
SwingRelation[0] == -1 is equal to LL/LH

Reply With Quote
The following 2 users say Thank You to dorschden for this post:
 
  #285 (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, 687 received


dorschden View Post
The parameters were interchanged. Try the edited code above.
And in the "using" region in the top of your indicator/strategy you have to add "using PriceActionSwing.Utility;".
Check for the SwingRelation value.
SwingRelation[0] == 1 is equal to HH/HL
SwingRelation[0] == -1 is equal to LL/LH

Thanks..... I just edited my post above that I found that swingRelation dataseries.

Just plotting arrows to confirm it is doing what I want(on a HH/HL).

Attached Thumbnails
PriceActionSwing discussion-testing.jpg  
Reply With Quote
 
  #286 (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, 687 received

@dorschden

I had everything working mostly the way I wanted it to. And this was mainly by taking the "PriceActionSwingTrend" indie, and deleting most of it, then adding in the things I needed. It worked fine.

Then I reloaded everything, then all of a sudden I get errors and the chart won't load. It is an error pertaining to not initializing, or checking for a null reference. I have been at it for a while and cannot seem to figure it out. I am wondering if you had run into a similar problem with the indicator before?

The error is pertaining to THIS i believe?

Running several iterations, commenting out various lines of code, I get the errors shown in the picture (there are only 3, but I've run it many times trying to figure out what was wrong).

Here is a code snippet. You don't have to comb over it entirely, but if you've seen this before, is there something OBVIOUSLY wrong that jumps out at you in the 'Initialize()' or 'OnBarUpdate()" blocks?

 
Code
//#region Variables
        //#####################################################################
        //Variables for PriceActionSwing
	private int swingSize = 2;
        private SwingTypes swingType = SwingTypes.Standard;
        private int dtbStrength = 15;
        private IDataSeries swingRelation;
        private IDataSeries swingTrend;
        private bool seeRelation = false;
        private bool useOldTrend = true;
        private bool paintBars = true;
        private int oldTrend = 0;
        private Color upTrendColour = Color.Green;
        private Color dnTrendColour = Color.Red;
        private Color noTrendColour = Color.Gray;
		
	//Variables for IchiCloud
	private int periodFast = 9;			// Default setting for PeriodFast
        private int periodMedium = 26;		// Default setting for PeriodMedium
        private int periodSlow = 52;		// Default setting for PeriodSlow
		
	//Variables independant to FPCJTrend
	private bool blueCloud = false;
	private bool redCloud = false;
	private int ichiBuffer = 6;
		
        //#####################################################################
        //#endregion

        /// <summary>
        /// This method is used to configure the indicator and is called once before any bar data is loaded.
        /// </summary>
        protected override void Initialize()
        {
            
	    //Add(new Plot(new Pen(Color.Firebrick, 20), PlotStyle.Square, "DoubleTop"));
            Add(new Plot(new Pen(Color.Red, 20), PlotStyle.Square, "DownTrend"));
            Add(new Plot(new Pen(Color.Gold, 20), PlotStyle.Square, "NoWhere"));
            Add(new Plot(new Pen(Color.Green, 20), PlotStyle.Square, "UpTrend"));
            //Add(new Plot(new Pen(Color.Lime, 20), PlotStyle.Square, "DoubleBottom"));
			
            CalculateOnBarClose = true;
            Overlay				= true;
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {	
			
			
		if (CurrentBar < swingSize)		
                        return;							//Do we have enough bars for PriceActionSwing
			
		if ((CurrentBar < periodMedium) || (CurrentBar < periodFast))
			return;							// Do we have enough bars for Ichi Calculation
			

		if (CurrentBar < 1)
               {
                     if (swingRelation == null && seeRelation)
                              swingRelation = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingRelation;
                     if (swingTrend == null && !seeRelation)
                              swingTrend = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingTrend;
                }
			
		double spanA = IchiCloud(Input, periodFast, periodMedium, periodSlow).SenkouSpanA[0];
		double spanB = IchiCloud(Input, periodFast, periodMedium, periodSlow).SenkouSpanB[0];
						
		if(spanA > spanB)
			{
				blueCloud = true;	
				redCloud = false;
			}
			
		if(spanA < spanB)
			{
				redCloud = true;
				blueCloud = false;
			}
			
		if(redCloud == true)
			{
				DrawArrowDown("arrow"+CurrentBar, true, 0, Low[0]+12*TickSize, Color.Red);	
			}
			
			
			///*
                if (swingTrend[0] == 1 && blueCloud == true && Low[0] > spanA-ichiBuffer*TickSize)
			{
				UpTrend.Set(1);
				//DrawArrowUp("arrow"+CurrentBar, true, 0, Low[0]-12*TickSize, Color.Green);
				//Print("hi");
			}
            
		else if (swingTrend[0] == -1 && redCloud == true && High[0] < spanA+ ichiBuffer*TickSize)
			{
				DownTrend.Set(1);
				//DrawArrowDown("arrow"+CurrentBar, true, 0, Low[0]+12*TickSize, Color.Red);
			}
			
		else
			{
				NoWhere.Set(1);	
			}

Attached Thumbnails
PriceActionSwing discussion-prime2011-07-16_225051.jpg  
Reply With Quote
 
  #287 (permalink)
Elite Member
Buderim Queensland Australia
 
Futures Experience: Advanced
Platform: ninja
Broker/Data: AMP/Zenfire
Favorite Futures: 6E, 6B, YM
 
Posts: 79 since Jul 2009
Thanks: 120 given, 24 received

Bottom


forrestang View Post
Thanks..... I just edited my post above that I found that swingRelation dataseries.

Just plotting arrows to confirm it is doing what I want(on a HH/HL).


Where can i find the trend indicator on the bottom of your chart??

Thanks a million

Reply With Quote
 
  #288 (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, 687 received


ticnau View Post
Where can i find the trend indicator on the bottom of your chart??

Thanks a million



I'm not sure what you mean? Are you referring to the one called "PriceActionTrend?" That's in the download section, created by the OP of this post. In there, are two studies. One is called "PriceActionSwing" and the other is called "PriceActionSwingTrend."

If you are referring to the indie at the VERY bottom, that's my indicator I'm working on and at the momement isn't working.

Reply With Quote
The following user says Thank You to forrestang for this post:
 
  #289 (permalink)
Elite Member
Milan Italy
 
Futures Experience: Intermediate
Platform: Ninjatrader, Sierra Chart
Favorite Futures: ES
 
Posts: 523 since Feb 2010
Thanks: 470 given, 629 received

Looks like the "if CurrentBar < 1 " section should come first. otherwise swingTrend and swingRelation have no value set.

We're working along similar lines....

Reply With Quote
 
  #290 (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, 687 received



futuretrader View Post
Looks like the "if CurrentBar < 1 " section should come first. otherwise swingTrend and swingRelation have no value set.

We're working along similar lines....

I dunno....... I actually have that first the way my script sits now. I still get the same error.



-----EDIT------
I commented out the first portion in void onBarUpdate. See this code snippet and my indie is now working. I'm not sure what those where there for, but they must have a purpose I am failing to understand.
 
Code
if (CurrentBar < 1)
       {
              //if (swingRelation == null && seeRelation)
               swingRelation = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingRelation;
				
              //if (swingTrend == null && !seeRelation)
              swingTrend = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingTrend;
       }


Last edited by forrestang; July 17th, 2011 at 03:19 AM.
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)

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

Dec 7

Linda Bradford Raschke: TBA

Elite only

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 10:03 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-11-21 in 0.09 seconds with 19 queries on phoenix via your IP 54.81.139.56