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

  #1091 (permalink)
 
JGSmith's Avatar
 JGSmith 
Lübeck, Germany
 
Experience: Intermediate
Platform: NinjaTrader, MT4
Broker: FXCM, Interactive Brokers, Oanda
Trading: Forex
Posts: 151 since Aug 2013
Thanks Given: 61
Thanks Received: 55

Hello

I am struggling with figuring out one of the parameters when attempting to use this with another indicator.

I am simply trying to code an indicator that will keep a running total of the Higher High, Lower High, & Double Tops. In the list of the parameters when referencing this indicator, it says "SwingStyle swingType".

As far as I can tell, I have inputted the other parameters correctly, but this one I can not figure out exactly what I am supposed to place there. I have tried placing "Standard", or "SwingStyle.Standard" or "swingType.Standard" and none of them are working. With all of them I get the compile error saying "XYZ does not exist in the current context."

Could somebody please let me know what I am supposed to put in this parameter if I wise to use Standard swing type?

Thank you very much for your help!!

"Most people overestimate what they can do in 1 year and underestimate what they can do in 10 years."
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Futures True Range Report
The Elite Circle
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Better Renko Gaps
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
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
22 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #1092 (permalink)
 kmac 
Melbourne, Victoria - Australia
 
Experience: Beginner
Platform: NinjaTrader
Trading: Oil
Posts: 16 since Jun 2012
Thanks Given: 16
Thanks Received: 2

Hello,

I have been using this great indicator for a few weeks now. Thanks to the creator and contributors.

I was wondering if a user defined minimum swing size in ticks/points could be set before drawing the fib retracement or extension. The fibs get a bit messy with smaller swings.

Thanks

Reply With Quote
  #1093 (permalink)
 
JGSmith's Avatar
 JGSmith 
Lübeck, Germany
 
Experience: Intermediate
Platform: NinjaTrader, MT4
Broker: FXCM, Interactive Brokers, Oanda
Trading: Forex
Posts: 151 since Aug 2013
Thanks Given: 61
Thanks Received: 55


Hello

I am just wondering if anybody has an answer for Post #1091. Even if just a couple of words without any explanation would be really great to fulfill my needs.

Thank you very much!!!

"Most people overestimate what they can do in 1 year and underestimate what they can do in 10 years."
Reply With Quote
  #1094 (permalink)
 
Zxeses's Avatar
 Zxeses 
San Francisco CA
 
Experience: Intermediate
Platform: Ninja
Broker: CQG
Trading: ES
Posts: 139 since Jun 2014
Thanks Given: 90
Thanks Received: 172


JGSmith View Post
Hello

I am struggling with figuring out one of the parameters when attempting to use this with another indicator.

I am simply trying to code an indicator that will keep a running total of the Higher High, Lower High, & Double Tops. In the list of the parameters when referencing this indicator, it says "SwingStyle swingType".

As far as I can tell, I have inputted the other parameters correctly, but this one I can not figure out exactly what I am supposed to place there. I have tried placing "Standard", or "SwingStyle.Standard" or "swingType.Standard" and none of them are working. With all of them I get the compile error saying "XYZ does not exist in the current context."

Could somebody please let me know what I am supposed to put in this parameter if I wise to use Standard swing type?

Thank you very much for your help!!

#region Using declarations
using PriceActionSwing.Base;
#endregion

#region Variables
private SwingStyle MyswingType = SwingStyle.Standard;
private PriceActionSwingPro pasP;
#endregion

protected override void OnStartUp()
{
pasP = PriceActionSwingPro(20, 7, MyswingType, false);
}

Thats as far as I've been able to get, I'm trying to extract info about the last swing to discover what it was, but after reviewing the code over and over I've not yet figured it out. I've been through about 10 or so pages of posts, I'll let you know if I find the post or discover the solution in code.

-Zx

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #1095 (permalink)
 
djkiwi's Avatar
 djkiwi 
Mercer Island WA
 
Experience: Advanced
Platform: Ninjatrader/Strategy Desk
Broker: Various
Trading: TF/NQ/ES/Stocks
Posts: 561 since May 2010
Thanks Given: 981
Thanks Received: 1,558


JGSmith View Post
Hello

I am just wondering if anybody has an answer for Post #1091. Even if just a couple of words without any explanation would be really great to fulfill my needs.

Thank you very much!!!

I'm not really sure what you guys are trying to do but this is how I'm accessing the revised swing indicator for other indicators. You can use the same concept for the pro version.

delcarations

using PriceActionSwing.Utility;

variables

private int dtbStrength = 15;
private int swingSize = 4;
private SwingTypes swingType = SwingTypes.Gann;
private IDataSeries swingRelation;

onstartup

swingRelation = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingRelation;

onbarupdate

for buy signals swingRelation[0] == 1
for sell signals swingRelation[0] == -1

Reply With Quote
  #1096 (permalink)
 harry737 
london, UK
 
Experience: Intermediate
Platform: NT
Broker: NT
Trading: Stocks, Bonds
Posts: 142 since Sep 2013
Thanks Given: 183
Thanks Received: 62

It looks like that I may be missing a file, when I compile the script posted on page 60 for the strategy base, I get the errors that "The namespace Utility does not exist in the NameSpace PriceActionSwing. I believe I may be missing a file possibly because SwingTypes can not be found either. Does any one have any information as to what file the Utility namespace is held so I can check if I have all of the correct files I need.


Any assistance on this would be greatly appreciated

Reply With Quote
  #1097 (permalink)
 
Silvester17's Avatar
 Silvester17 
Columbus, OH
Market Wizard
 
Experience: None
Platform: NT 8, TOS
Trading: ES
Posts: 3,603 since Aug 2009
Thanks Given: 5,139
Thanks Received: 11,527


harry737 View Post
It looks like that I may be missing a file, when I compile the script posted on page 60 for the strategy base, I get the errors that "The namespace Utility does not exist in the NameSpace PriceActionSwing. I believe I may be missing a file possibly because SwingTypes can not be found either. Does any one have any information as to what file the Utility namespace is held so I can check if I have all of the correct files I need.

Any assistance on this would be greatly appreciated

you shouldn't be using "PriceActionSwing.Utility". that was used before the latest update. now we have "PriceActionSwing.Base"

Reply With Quote
Thanked by:
  #1098 (permalink)
 harry737 
london, UK
 
Experience: Intermediate
Platform: NT
Broker: NT
Trading: Stocks, Bonds
Posts: 142 since Sep 2013
Thanks Given: 183
Thanks Received: 62

What file is the SwingTypes enum is located in, there seems to be a missing reference related to this
#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;
#endregion
using PriceActionSwing.Base;
// 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 Test : Strategy
{

private int swingSize = 7;
private SwingTypes swingType = SwingTypes.Standard;
private int dtbStrength = 15;
private DataSeries swingTrend;

protected override void Initialize()
{
BarsRequired = 0;
CalculateOnBarClose = true;
Enabled = false;

swingTrend = new DataSeries(this);
}

protected override void OnStartUp()
{
//pasOsc = PriceActionSwingOscillator(Input, dtbStrength, swingSize, swingType);
//swingTrend = pasOsc.SwingTrend;

swingTrend = PriceActionSwingOscillator(Input, dtbStrength, swingSize, swingType).SwingTrend;
}

protected override void OnBarUpdate()
{
if (CurrentBar < 20)
return;

// For testing only
//DrawText(CurrentBar + "Tag", swingTrend[0].ToString(), 0, Low[0] - 10 * TickSize, Color.Red);

if (Position.MarketPosition == MarketPosition.Flat)
{
if (swingTrend[0] == 1)
EnterLong();
if (swingTrend[0] == -1)
EnterShort();
}
else if (Position.MarketPosition == MarketPosition.Long)
{
if (swingTrend[0] != 1)
ExitLong();
}
else if (Position.MarketPosition == MarketPosition.Short)
{
if (swingTrend[0] != -1)
ExitShort();
}
}

#region Properties
[Description("")]
[GridCategory("Parameters")]
public int MyInput0
{
get { return myInput0; }
set { myInput0 = Math.Max(1, value); }
}
#endregion
}
}
many Thanks,

Reply With Quote
  #1099 (permalink)
 dstrader 
Chicago, USA
 
Experience: Advanced
Platform: TS, NT, TOS, SSE, IRT
Trading: ES, currency futures, options, stocks
Posts: 195 since Dec 2010
Thanks Given: 330
Thanks Received: 275

The variable declaration should be:

private SwingStyle swingType = SwingStyle.Standard;


if you are using the latest version of PAS indicator.

Reply With Quote
Thanked by:
  #1100 (permalink)
 NathanExplosion 
Columbus
 
Experience: Beginner
Platform: NinjaTrader
Trading: Es, forex, stocks
Posts: 23 since Oct 2011
Thanks Given: 7
Thanks Received: 17


I'm back attempting to add price action swing to a strategy I want to back test. Thank you @dorschden for such a great indicator and all your help and hard work!

I don't know how to access when the indicator flips. I get an error about not being able to use this method with the following code. I asked a similar question awhile back and got this answer. According to this, I should be able to access the public bool series for the PpFlip and DnFlip functions.

@NathanExplosion, unfortunately this isn't possible. You have to change the code to accomplish this. There are several ways to do this. Because of your moderate coding skills I suggest that you create some variables to save the certain swing relations and make them public. E.g. create a variable called lastLowRelation2 in which you save the 3rd last swing low relation (swing low relation = LL, HL, DB) and in line 2582 you write "lastLowRelation2 = lastLowRelation;" Then you have in the variables curLowRelation, lastLowRelation, lastLowRelation2 the swing low relations. Now you have to make this variables accessible. In "Region Properties" in "Region Dataseries" you add following line for each variable (same for the long values). Now you should be able to access the values from within a strategy. I didn't test this, but it should work.


PriceActionSwingPro indicator

public BoolSeries DnFlip
{
get { return dnFlip; }
}

public BoolSeries UpFlip
{
get { return upFlip; }
}

my strategy

protected override void OnBarUpdate()
{
if (PriceActionSwingPro(20, 7, PriceActionSwing.Base.SwingStyle.Standard, false).UpFlip[0] == true)
{
// do something
}
else if (PriceActionSwingPro(20, 7, PriceActionSwing.Base.SwingStyle.Standard, false).DnFlip[0] == true)
{
// do something
}
}

Attached is the error I get when trying to compile my strategy. Anyone with C# experience know what's going on with this and how to get it to work?

Thanks in advance!

Attached Thumbnails
Click image for larger version

Name:	help.jpg
Views:	191
Size:	258.4 KB
ID:	158564  
Reply With Quote




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