NexusFi: Find Your Edge


Home Menu

 





PriceActionSwing discussion


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Silvester17 with 177 posts (570 thanks)
    2. looks_two dorschden with 99 posts (1,124 thanks)
    3. looks_3 Big Mike with 52 posts (90 thanks)
    4. looks_4 jmont1 with 51 posts (23 thanks)
      Best Posters
    1. looks_one dorschden with 11.4 thanks per post
    2. looks_two Silvester17 with 3.2 thanks per post
    3. looks_3 Big Mike with 1.7 thanks per post
    4. looks_4 sudhirc with 1.7 thanks per post
    1. trending_up 965,554 views
    2. thumb_up 2,947 thanks given
    3. group 613 followers
    1. forum 2,093 posts
    2. attach_file 615 attachments




 
Search this Thread

PriceActionSwing discussion

  #1801 (permalink)
 jmont1 
New York, NY
 
Experience: Intermediate
Platform: NinjaTrader8
Broker: Data = Rithmic -- Gives 70 Level II Data
Trading: 6C (Low Margin,) 6E, CL, GC, ES and Maybe DX for smaller tick value
Posts: 1,394 since May 2011
Thanks Given: 1,719
Thanks Received: 1,019


iq200 View Post
Let me see whats going on.

BTW, my volume indicator isnt anything special. It just highlights the volume bars with colours depending on if the close is <, > or = to open.

@iq200, others have also downloaded this.

May I request any input if others were able to get it working?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Build trailing stop for micro index(s)
Psychology and Money Management
Futures True Range Report
The Elite Circle
Exit Strategy
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #1802 (permalink)
 iq200 
London, UK
 
Experience: Intermediate
Platform: Ninjatrader, Tradestation
Broker: Kinetick, InteractiveBrokers
Trading: Equities, Futures
Posts: 407 since Jun 2010
Thanks Given: 145
Thanks Received: 278

I found the main problem why you couldn't use my template. I moved the PasPro indicators in the NT8 hierarchy to where all the indicators reside. so when you loaded the template it couldn't find the indcators.

After doing a diff, I found that the version of indicators I have are from an older release and you would have been a bit screwed possibly in terms of functionality and settings so I didn't want to take the risk.

Therefore, I removed all my indicators, re-added all the indicators from the futures.io downloads area and recreated the template for you. You should be able to use this template with the indicators in the downloads area.

If you still want the volume indicator (I described above the functionality I added) let me know.

Sorry it took it a little time to find out what the cause was as I didn't want to screwup your system.

Here's a pic of what you should be seeing...

Attached Thumbnails
Click image for larger version

Name:	2019-10-05_20-14-25.jpg
Views:	371
Size:	57.5 KB
ID:	277021  
Attached Files
Elite Membership required to download: TradingMarketAnalyzer.PriceActionSwing.Orig.xml
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #1803 (permalink)
 jmont1 
New York, NY
 
Experience: Intermediate
Platform: NinjaTrader8
Broker: Data = Rithmic -- Gives 70 Level II Data
Trading: 6C (Low Margin,) 6E, CL, GC, ES and Maybe DX for smaller tick value
Posts: 1,394 since May 2011
Thanks Given: 1,719
Thanks Received: 1,019



iq200 View Post
I found the main problem why you couldn't use my template. I moved the PasPro indicators in the NT8 hierarchy to where all the indicators reside. so when you loaded the template it couldn't find the indcators.

After doing a diff, I found that the version of indicators I have are from an older release and you would have been a bit screwed possibly in terms of functionality and settings so I didn't want to take the risk.

Therefore, I removed all my indicators, re-added all the indicators from the nexusfi.com downloads area and recreated the template for you. You should be able to use this template with the indicators in the downloads area.

If you still want the volume indicator (I described above the functionality I added) let me know.

Sorry it took it a little time to find out what the cause was as I didn't want to screwup your system.

Here's a pic of what you should be seeing...

@iq200, thanks for all that effort -- I similarly went and loaded NT7 to try and help his original request.

This version basically gets us back to where I left him since it does not use -1, 0, 1 or other numerals to provide the information. And it does what I was suggesting - color if > 0.

And it does not allow for changing the Label header. So it is likely you did customize PAS. So either the altered PAS is required or we can give up on it.

I think we have put enough effort into this.


Reply With Quote
  #1804 (permalink)
 iq200 
London, UK
 
Experience: Intermediate
Platform: Ninjatrader, Tradestation
Broker: Kinetick, InteractiveBrokers
Trading: Equities, Futures
Posts: 407 since Jun 2010
Thanks Given: 145
Thanks Received: 278


jmont1 View Post
@iq200, thanks for all that effort -- I similarly went and loaded NT7 to try and help his original request.

This version basically gets us back to where I left him since it does not use -1, 0, 1 or other numerals to provide the information. And it does what I was suggesting - color if > 0.

And it does not allow for changing the Label header. So it is likely you did customize PAS. So either the altered PAS is required or we can give up on it.

I think we have put enough effort into this.


The reason you can't override the column labels is that in the PriceActionSwing code, the indicator label property is hardcoded. It's a bad way to code but nothing I can do about that.. If you want to override the column labels, just open the indicator code and comment out the indicator label property and recompile... Specifically, if you open PriceActionSwing.cs (latest version from the downloads area) and comment out line 279 as follows, you will be able to change the column labels:

//displayName = Name + "(" + Instrument.FullName + " (" + BarsPeriod.Value + " " + BarsPeriod.BarsPeriodType + "), " + SwingType + ", " + SwingSize + ", " + DtbStrength + ")";

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #1805 (permalink)
FTraderAza
Bendigo Victoria Australia
 
Posts: 1 since Aug 2019
Thanks Given: 1
Thanks Received: 0

Hi Everyone.

Sorry if I'm asking dumb questions. I'm new to NinjaTrader and this is the first time I have imported anything.

I tried to install The Price Action Swing indicator I downloaded from this forum on NinjaTrader 8 and received a series of errors saying that existing indicator files on my PC were newer than the ones contained in the archive file I am importing. It asked if I wanted to replace the exisiting files and I said no to each one (there were several) because my copies were newer.

I then got another error saying:

"Import failed. The Ninjascript Archive File may contain duplicate method names that already exist on your PC, modify a method signature that other scripts were dependent on, or be missing a required file on either your PC or in the import archive."

Seems like it might have failed because I said no to replacing those files. Any idea why this is happening? Is it OK for me to replace the files with older ones?

I am using a brand new install of NinjaTrader 8.0.19.1.

I tried looking on the forum before making this post and couldn't find anything.

Thanks

Reply With Quote
  #1806 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,162 since Jan 2013
Thanks Given: 57,343
Thanks Received: 26,267


muzhik View Post
Hi Guys!
Please help with the strategy code for NT8 using PriceActionSwingPro. I looked through the forum, in one post there were tips. I tried to create a simple strategy, but it throws an error. Here is the code:


#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Gui.SuperDom;
using NinjaTrader.Gui.Tools;
using NinjaTrader.Data;
using NinjaTrader.NinjaScript;
using NinjaTrader.Core.FloatingPoint;
using NinjaTrader.NinjaScript.Indicators;
using NinjaTrader.NinjaScript.DrawingTools;
using PriceActionSwing.Base;
#endregion

//This namespace holds Strategies in this folder and is required. Do not change it.
namespace NinjaTrader.NinjaScript.Strategies
{
public class MyCustomStrategy2 : Strategy
{
private NinjaTrader.NinjaScript.Indicators.PriceActionSwing.PriceActionSwingPro _pasPro;

protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Strategy here.";
Name = "MyCustomStrategy2";
Calculate = Calculate.OnBarClose;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
IsExitOnSessionCloseStrategy = true;
ExitOnSessionCloseSeconds = 30;
IsFillLimitOnTouch = false;
MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
OrderFillResolution = OrderFillResolution.Standard;
Slippage = 0;
StartBehavior = StartBehavior.WaitUntilFlat;
TimeInForce = TimeInForce.Gtc;
TraceOrders = false;
RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
StopTargetHandling = StopTargetHandling.PerEntryExecution;
BarsRequiredToTrade = 20;
// Disable this property for performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = true;
}
else if (State == State.Configure)
{

_pasPro = PriceActionSwingPro(SwingStyle.Gann, 5, 20, false, AbcPatternMode.Long_Short, DivergenceMode.Custom, DivergenceDirection.Long_Short, 10, 26, 9, false, false, false, false, SwingLengthStyle.False, SwingDurationStyle.False, false, false, false, SwingTimeStyle.False, SwingVolumeStyle.False, VisualizationStyle.False, 15, 30, 45, 60, 75, 90, DashStyleHelper.Solid, 3, false, 10, DashStyleHelper.Solid, DashStyleHelper.Dash, 2, 2, 50, 92, 61, DashStyleHelper.Solid, 4, 38, true, true, 5, true, true, DashStyleHelper.Dot, DashStyleHelper.Dot, 2, 2, false, DashStyleHelper.Solid, 1, true, true, true, true, Priority.High, Priority.High, "AbcLong.wav", "AbcLongEntry.wav", "AbcShort.wav", "AbcShortEntry.wav", false, Priority.Medium, "DoubleBottom", "DoubleBottom.wav", 0, false, Priority.Medium, "DoubleTop", "DoubleTop.wav", 0, false, Priority.Medium, "HigherLow", "HigherLow.wav", 0, false, Priority.Medium, "LowerHigh", "LowerHigh.wav", 0, false, Priority.Medium, "SwingChange", "SwingChange.wav", 0, true, Priority.Medium, "DivergenceRegularHigh", "DivergenceRegularHigh.wav", 0, true, Priority.Medium, "DivergenceHiddenHigh", "DivergenceHiddenHigh.wav", 0, true, Priority.Medium, "DivergenceRegularLow", "DivergenceRegularLow.wav", 0, true, Priority.Medium, "DivergenceHiddenLow", "DivergenceHiddenLow.wav", 0);

}

}


protected override void OnBarUpdate()
{
//Add your custom strategy logic here.

if (_pasPro.abcSignal[0] == 2)
{
EnterLong(DefaultQuantity, "");
}
}

}
}



Regards,

Hi @muzhik,

A few pointers on getting coding help:

The most important thing is to first explain, in plain, regular English, what you want the code to do, if possible with examples and with a chart image. (For example, "When this happens, I want this other thing to happen. See the chart.") If you just throw out some code and say "This didn't work," without saying what it is supposed to do, you're not likely to get too many programmers who want to try to puzzle out what you intended. The explanation of what you wanted to do is far more important than showing the code that didn't do what you wanted to do.

Also, here's a tip for including code in your post: never just copy it into a post as text, because it loses all the formatting, making it very hard to follow the logic.

Instead, use the button at the top of the edit window marked with a "#" to wrap "code tags" around the selected text. (Click the button and insert the code between the "CODE" and "/CODE" tags that appear at your cursor location in the window, or highlight the code and then click the "#" button, which inserts the tags before and after the highlighting.) This is what you get when you do:

 
Code
#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Gui.SuperDom;
using NinjaTrader.Gui.Tools;
using NinjaTrader.Data;
using NinjaTrader.NinjaScript;
using NinjaTrader.Core.FloatingPoint;
using NinjaTrader.NinjaScript.Indicators;
using NinjaTrader.NinjaScript.DrawingTools;
using PriceActionSwing.Base;
#endregion

//This namespace holds Strategies in this folder and is required. Do not change it. 
namespace NinjaTrader.NinjaScript.Strategies
{
	public class MyCustomStrategy2 : Strategy
	{
		private NinjaTrader.NinjaScript.Indicators.PriceActionSwing.PriceActionSwingPro _pasPro;

		protected override void OnStateChange()
		{
			if (State == State.SetDefaults)
			{
				Description									= @"Enter the description for your new custom Strategy here.";
				Name										= "MyCustomStrategy2";
				Calculate									= Calculate.OnBarClose;
				EntriesPerDirection							= 1;
				EntryHandling								= EntryHandling.AllEntries;
				IsExitOnSessionCloseStrategy				= true;
				ExitOnSessionCloseSeconds					= 30;
				IsFillLimitOnTouch							= false;
				MaximumBarsLookBack							= MaximumBarsLookBack.TwoHundredFiftySix;
				OrderFillResolution							= OrderFillResolution.Standard;
				Slippage									= 0;
				StartBehavior								= StartBehavior.WaitUntilFlat;
				TimeInForce									= TimeInForce.Gtc;
				TraceOrders									= false;
				RealtimeErrorHandling						= RealtimeErrorHandling.StopCancelClose;
				StopTargetHandling							= StopTargetHandling.PerEntryExecution;
				BarsRequiredToTrade							= 20;
				// Disable this property for performance gains in Strategy Analyzer optimizations
				// See the Help Guide for additional information
				IsInstantiatedOnEachOptimizationIteration	= true;
			}
			else if (State == State.Configure)
			{

				_pasPro = PriceActionSwingPro(SwingStyle.Gann, 5, 20, false, AbcPatternMode.Long_Short, DivergenceMode.Custom, DivergenceDirection.Long_Short, 10, 26, 9, false, false, false, false, SwingLengthStyle.False, SwingDurationStyle.False, false, false, false, SwingTimeStyle.False, SwingVolumeStyle.False, VisualizationStyle.False, 15, 30, 45, 60, 75, 90, DashStyleHelper.Solid, 3, false, 10, DashStyleHelper.Solid, DashStyleHelper.Dash, 2, 2, 50, 92, 61, DashStyleHelper.Solid, 4, 38, true, true, 5, true, true, DashStyleHelper.Dot, DashStyleHelper.Dot, 2, 2, false, DashStyleHelper.Solid, 1, true, true, true, true, Priority.High, Priority.High, "AbcLong.wav", "AbcLongEntry.wav", "AbcShort.wav", "AbcShortEntry.wav", false, Priority.Medium, "DoubleBottom", "DoubleBottom.wav", 0, false, Priority.Medium, "DoubleTop", "DoubleTop.wav", 0, false, Priority.Medium, "HigherLow", "HigherLow.wav", 0, false, Priority.Medium, "LowerHigh", "LowerHigh.wav", 0, false, Priority.Medium, "SwingChange", "SwingChange.wav", 0, true, Priority.Medium, "DivergenceRegularHigh", "DivergenceRegularHigh.wav", 0, true, Priority.Medium, "DivergenceHiddenHigh", "DivergenceHiddenHigh.wav", 0, true, Priority.Medium, "DivergenceRegularLow", "DivergenceRegularLow.wav", 0, true, Priority.Medium, "DivergenceHiddenLow", "DivergenceHiddenLow.wav", 0);

			}
				
			}
		

		protected override void OnBarUpdate()
		{
			//Add your custom strategy logic here. 

  		 if  (_pasPro.abcSignal[0] == 2)
		 {	
      			EnterLong(DefaultQuantity, "");
		 }
		}

	}
}

Now, if you're not a coder you may not see this as a big deal, but I can read this, and I couldn't make heads or tails out of the unformatted version. This is not your fault, because the text editor on FIO strips out any formatting that the original may have had. But if you use the "#" button you can put it back in. Otherwise, it's just a big unreadable blob of text.

Also, if something gives you an error, you need to tell people what the error is. Just saying "an error" doesn't tell anyone enough to get their teeth into it.

Finally, you probably will have better luck posting your question in the free NT strategy thread, here:

If you post there, make sure you explain as much as you can about what you are trying to accomplish. Frankly, posting the code that didn't work is not nearly as important as saying what you are looking for it to do. In fact, posting non-working code without explanations of any kind is not useful at all. It may make sense, after you've explained what you are aiming for, to then show the code you've tried out, with any error messages you received. But not before the explanation.

Sorry to harp on this so much, but it is the most important thing: You need to give programmers a little help if you are looking for help.

I know it isn't easy, and it's hard to wrap your head around something like coding, which is highly technical and may be unfamiliar to you.

Good luck with this.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
Thanked by:
  #1807 (permalink)
alvaroinvesting
Madrid, Spain
 
Posts: 2 since Dec 2019
Thanks Given: 2
Thanks Received: 1

Hello everyone!

I just arrived to this great PAS indicator a weeek ago.

I'm trying to implement it to my strategy coding, but I'm finding difficulties when accessing to the values the indicator generates. Normally this is easy to get from other indicators, but I'm not being able to understand hte indicator's development to do what I want to do.

So, maybe some of you can help me to implement this:

For the current bar, I want to take the Price from which the Swing is made.

I attach an example, for me to explain better. In such example, I want to get as data for the strategy the start Price of the present Green swing. As shown in the image, the data it would return in this case is 12174,5.

I don't know if maybe this is too easy to do and I'm not finding it, but I have read the thread and didn't find how to do it.

Thank you very much.

Attached Thumbnails
Click image for larger version

Name:	Start Price Example.png
Views:	346
Size:	91.5 KB
ID:	282098  
Reply With Quote
  #1808 (permalink)
 
Botts's Avatar
 Botts 
Penetanguishene, Ontario, Canada
 
Experience: None
Platform: NinjaTrader-8
Broker: NinjaTrader Brokerage, Continuum
Trading: ZB, MES, NQ, YM
Posts: 924 since Jun 2011
Thanks Given: 4,019
Thanks Received: 3,605


alvaroinvesting View Post
Hello everyone!

I just arrived to this great PAS indicator a weeek ago.

I'm trying to implement it to my strategy coding, but I'm finding difficulties when accessing to the values the indicator generates. Normally this is easy to get from other indicators, but I'm not being able to understand hte indicator's development to do what I want to do.

So, maybe some of you can help me to implement this:

For the current bar, I want to take the Price from which the Swing is made.

I attach an example, for me to explain better. In such example, I want to get as data for the strategy the start Price of the present Green swing. As shown in the image, the data it would return in this case is 12174,5.

I don't know if maybe this is too easy to do and I'm not finding it, but I have read the thread and didn't find how to do it.

Thank you very much.

I don't use the PAS indicator but just a quick look at that screenshot of yours would suggest to me that the swing low you're referring to would not be available on the chart in real time until the next bar closes after that swing low is put in.

Simply put, the data would not be available for you to trigger an entry in your strategy in real time.

I hope that helps you in your quest.

R.I.P. John Bottomley (Botts), 1956-2022.
Please visit this thread for more information.
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #1809 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,162 since Jan 2013
Thanks Given: 57,343
Thanks Received: 26,267


alvaroinvesting View Post
Hello everyone!

I just arrived to this great PAS indicator a weeek ago.

I'm trying to implement it to my strategy coding, but I'm finding difficulties when accessing to the values the indicator generates. Normally this is easy to get from other indicators, but I'm not being able to understand hte indicator's development to do what I want to do.

So, maybe some of you can help me to implement this:

For the current bar, I want to take the Price from which the Swing is made.

I attach an example, for me to explain better. In such example, I want to get as data for the strategy the start Price of the present Green swing. As shown in the image, the data it would return in this case is 12174,5.

I don't know if maybe this is too easy to do and I'm not finding it, but I have read the thread and didn't find how to do it.

Thank you very much.


TopGunNote View Post
I don't use the PAS indicator but just a quick look at that screenshot of yours would suggest to me that the swing low you're referring to would not be available on the chart in real time until the next bar closes after that swing low is put in.

Simply put, the data would not be available for you to trigger an entry in your strategy in real time.

I hope that helps you in your quest.

It's been a while since I used NT, but as I recall, PriceActionSwing marks a swing point when it's the low (or high) of a 7-bar range. So you don't know that something was a swing turning point until 7 bars later (you can set this parameter, but it is never going to not have a lag, and the lower you set it, the more likely to get a swing turn that is too minor to use.)

This is generally going to be the case for swing-finding, zig-zag indicators -- it takes some time or some amount of change to know that the swing has ended.

Bob.

----------------

Edit: I did a post several years ago in this thread showing how PAS works, based on the 7-bar (or x-bar) range. It's a great indicator, but it's always going to need to look back to see whether the x-bar low or high has been exceeded, before declaring it a turning point.

Post is here, with a chart that may help:

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
Thanked by:
  #1810 (permalink)
alvaroinvesting
Madrid, Spain
 
Posts: 2 since Dec 2019
Thanks Given: 2
Thanks Received: 1


Hi again!

Thank you TopGunNote and Bob for your quick replies. You both made me better understand the indicator, so I'll have to redesign its role in my strategy, since what I wanted to do seems unapproachable in realtime.

Reply With Quote
Thanked by:




Last Updated on January 7, 2024


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts