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,125 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 978,214 views
    2. thumb_up 2,948 thanks given
    3. group 613 followers
    1. forum 2,093 posts
    2. attach_file 615 attachments




 
Search this Thread

PriceActionSwing discussion

  #81 (permalink)
 wgreenie 
Cambridge, Ontario
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Zen-Fire
Trading: 6E
Posts: 1,778 since Dec 2009
Thanks Given: 1,258
Thanks Received: 1,203

Hi Dorschden

I followed Post #7 and tried to add your PA indicator to my strategy as Exit. Got an error message "No overload for method 'PriceActionSwing' takes '3' arguments" when I tried to compile. Appreciate your kind suggestion on how to fix my code (as follows) and what I did wrong. Thank you.

Beth

 
Code
 
//Exit Condition based on PA Swing
if (PriceActionSwing(pAS_SwingMode, pAS_DtbStrength, pAS_Span).PriceSwingRelation[0] == -1
&& CrossBelow(SMA(3), SMA(7), 1))
{
ExitLong();
}

if (PriceActionSwing(pAS_SwingMode, pAS_DtbStrength, pAS_Span).PriceSwingRelation[0] == 1
&& CrossAbove(SMA(3), SMA(7),1))
{
ExitShort();
}

Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #82 (permalink)
 dorschden 
Germany
 
Experience: Master
Platform: NinjaTrader
Posts: 112 since Jun 2009
Thanks Given: 59
Thanks Received: 1,144


alex5000 View Post
Just a suggestion, is it possible to have on "Swing Length" price/ticks/and bar count.

Hello Alex,

I upload a new version and add your suggestion. Download the new version ( here).

I also displaced the statistic from the chart to a text box panel. This works only in NT7. In NT6.5 the statistic is still on the chart.

[img]https://nexusfi.com/attachment.php?attachmentid=14973&d=1275832994[/img]

dorschden

Started this thread Reply With Quote
  #83 (permalink)
 alex5000 
Sydney
 
Experience: Intermediate
Platform: Ninja Trader
Posts: 85 since Nov 2009
Thanks Given: 26
Thanks Received: 50


thank you so much dorschden

Alex

Visit my NexusFi Trade Journal Reply With Quote
  #84 (permalink)
 dorschden 
Germany
 
Experience: Master
Platform: NinjaTrader
Posts: 112 since Jun 2009
Thanks Given: 59
Thanks Received: 1,144


wgreenie View Post
I will try to automate the PriceActionSwingRelation indicator .. seems do-able. Will knock at your door if I encounter any technical issues.


wgreenie View Post
Got an error message "No overload for method 'PriceActionSwing' takes '3' arguments" when I tried to compile.

Hello Beth,

the old code snippet isn't fully correct because I change the parameter number.

Try the following code (NT7 only). I didn't test it, but it should work. Don't hesitate to ask if you encounter some issues. I'll try to help if I can.

For you automatization you can also use the new UpFlip[0] series to get the information when the swing is change from low to high (DownFlip vice versa). For access use the same code and replace PriceSwingRelation with UpFlip.


 
Code
                            
#region Using declarations

using PriceActionSwing.Utility;
#endregion

#region Variables
private SwingMode calcMode SwingMode.Standard;
private 
int calcSize 8;
private 
int dtbStrength 15;
private 
double psarAcceleration    0.02;
private 
double psarAccelerationMax 0.2;
private 
double psarAccelerationStep0.02;

private 
IDataSeries     priceSwingRel;
#endregion


protected override void OnStartUp()
{
  
// Set the PriceActionSwingRelation value to to the priceSwingRel series
  
priceSwingRel PriceActionSwing(InputcalcModecalcSizedtbStrength,
    
psarAccelerationpsarAccelerationMaxpsarAccelerationStep).PriceSwingRelation;
}

protected 
override void OnBarUpdate()
{
  
//Exit Condition based on PA Swing
  
if (priceSwingRel[0] == -&& CrossBelow(SMA(3), SMA(7), 1))
  {
    
ExitLong();
  }

dorschden

Started this thread Reply With Quote
Thanked by:
  #85 (permalink)
 wgreenie 
Cambridge, Ontario
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Zen-Fire
Trading: 6E
Posts: 1,778 since Dec 2009
Thanks Given: 1,258
Thanks Received: 1,203


dorschden View Post
Don't hesitate to ask if you encounter some issues. I'll try to help if I can.

Hi Dorschden

Your prompt response has made my weekend. Thank you!

I tried the suggested code and did compile the strategy successfully. Unfortunately the revised strategy does not trigger any trades. FYI: Without the PA Swing code, the strategy does trigger trades. Well, I must have done something wrong ..

I will do some investigation first before bothering you again. For sure, you will hear from me if I have a big head after hours of getting no-where ...

Beth

Visit my NexusFi Trade Journal Reply With Quote
  #86 (permalink)
 dorschden 
Germany
 
Experience: Master
Platform: NinjaTrader
Posts: 112 since Jun 2009
Thanks Given: 59
Thanks Received: 1,144


wgreenie View Post

I tried the suggested code and did compile the strategy successfully. Unfortunately the revised strategy does not trigger any trades. FYI: Without the PA Swing code, the strategy does trigger trades.

Hey Beth,

if you use NT7 then you can use the edited code above. You have to use the OnStartUp() method to initialize the priceSwingRel series. If you use NT6.5 then the following code works. It's not the best performance solution but it works.

 
Code
                            
if (PriceActionSwing(calcModecalcSizedtbStrengthpsarAccelerationpsarAccelerationMax,

    
psarAccelerationStep).PriceSwingRelation[0] == -&& CrossBelow(SMA(3), SMA(7), 1))
{
  
ExitLong();


Started this thread Reply With Quote
Thanked by:
  #87 (permalink)
 wgreenie 
Cambridge, Ontario
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Zen-Fire
Trading: 6E
Posts: 1,778 since Dec 2009
Thanks Given: 1,258
Thanks Received: 1,203

Hi Dorschden

I used your latest suggestion to create a PA Swing strategy. Compiled successfully and it generated trades too. Thank you! Hey, You Rock!!

Now I will go through the trades and see how can I improve the strategy so that it will be profitable.

Beth (grateful)

Visit my NexusFi Trade Journal Reply With Quote
  #88 (permalink)
 wgreenie 
Cambridge, Ontario
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Zen-Fire
Trading: 6E
Posts: 1,778 since Dec 2009
Thanks Given: 1,258
Thanks Received: 1,203

Hi Dorschden

Need to pick your brains please. How can I add text label (HH/HL/LL/LH/DB/DT) in addition to the dots? Is it easy to learn how to code it? Appreciate your guidance. Thank you.

FYI: I succeeded in adding an Exit condition (PA Swing Rel = 1 or -1 and SMA crossover) to an existing strategy that I have been sim-trading. It really helps! My heartfelt thanks again for your sharing and assistance.

Have a Successful week.

Beth

Visit my NexusFi Trade Journal Reply With Quote
  #89 (permalink)
 dorschden 
Germany
 
Experience: Master
Platform: NinjaTrader
Posts: 112 since Jun 2009
Thanks Given: 59
Thanks Received: 1,144


wgreenie View Post
How can I add text label (HH/HL/LL/LH/DB/DT) in addition to the dots?

Hey Beth,

I upload a new version and add swing labels ( Download here). I thought the dot colors were enough, but the swing labels make it more visible.

Good to hear that the indicator help you with your exit conditions in the strategy.

dorschden

[img]https://nexusfi.com/attachment.php?attachmentid=15050&d=1275941399[/img]

Started this thread Reply With Quote
Thanked by:
  #90 (permalink)
 wgreenie 
Cambridge, Ontario
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Zen-Fire
Trading: 6E
Posts: 1,778 since Dec 2009
Thanks Given: 1,258
Thanks Received: 1,203



dorschden View Post
I upload a new version and add swing labels ( Download here). I thought the dot colors were enough, but the swing labels make it more visible.

Hi Dorschden

You're a "peach"!! I learned from my Western peers that it's a good compliment for one who's extraordinarily Nice - YOU!! Thank you.

For a PA newbie (me), the swing labels help a lot LOL!

Beth (grateful)

Visit my NexusFi Trade Journal 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