NexusFi: Find Your Edge


Home Menu

 





Need help with PKPriceAlert2 indicator


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one max-td with 9 posts (3 thanks)
    2. looks_two Todd with 9 posts (2 thanks)
    3. looks_3 ZTR with 2 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 6,018 views
    2. thumb_up 6 thanks given
    3. group 2 followers
    1. forum 21 posts
    2. attach_file 5 attachments




 
Search this Thread

Need help with PKPriceAlert2 indicator

  #1 (permalink)
 
Todd's Avatar
 Todd 
Alpharetta, GA
 
Experience: Intermediate
Platform: ninja
Broker: Mirus / Zenfire
Trading: ES
Posts: 234 since Jun 2009
Thanks Given: 28
Thanks Received: 40

I can get the PKPriceAlert2 indicator to work on CL, 6e and GC. It's actually pretty cool to be able to draw a horizontal line and get an audio alert at that price.

However, I can't get this indicator to work for 6a or 6e. After messing around with various tests, I can see that the problem lies in the code only looking for 2 digits instead of 4. Since 6a, 6e, 6b, etc have 4 digits after the 1 (1.3670, etc), the indicator in it's current form won't work on those.

Can someone tell me what lines to edit how to change the code to allow for 2 more digits so it can be used on currencies that have 4 digits after the decimal point?

Thanks,
Todd

Attached Files
Elite Membership required to download: PKPriceAlert2.zip
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
What broker to use for trading palladium futures
Commodities
 
  #3 (permalink)
 MartinS 
Aberdeen + UK
 
Experience: Intermediate
Platform: NinjaTrader, TradeStation
Trading: NQ
Posts: 6 since Dec 2009
Thanks Given: 0
Thanks Received: 3


in the following line, try changing the 2 to 4

double PriceAlert = Math.Round(CO.Value,2);

Reply With Quote
  #4 (permalink)
 
Todd's Avatar
 Todd 
Alpharetta, GA
 
Experience: Intermediate
Platform: ninja
Broker: Mirus / Zenfire
Trading: ES
Posts: 234 since Jun 2009
Thanks Given: 28
Thanks Received: 40

Thanks, Martin.. that seems to have worked.

Do you know how to make it so the sound alert wav file name gets typed into the indicator input screen instead of the actual code?

Todd

Started this thread Reply With Quote
  #5 (permalink)
 
ZTR's Avatar
 ZTR 
 
Experience: Advanced
Platform: NinjaTrader7
Broker: Mirus RCG/Zen-Fire
Trading: CL & 6e, looking at ES, ZB and AU again.
Posts: 2,096 since Nov 2009
Thanks Given: 1,099
Thanks Received: 1,393

If you look at the code of any indicator that has user defined input(s) there is code for each category near the bottom before the Ninja Generated code.

[Description("")]
[Category("Alerts")]
[Description("Sound")]

public bool Soundon
{
get { return soundOn; }
set { soundOn = value; }
}

[Description("Sound file foralert.")]
[Category("Alerts")]
public string Wavefilefame
{
get { return Wavefilename; }
set { Wavefilename = value; }

Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
Todd's Avatar
 Todd 
Alpharetta, GA
 
Experience: Intermediate
Platform: ninja
Broker: Mirus / Zenfire
Trading: ES
Posts: 234 since Jun 2009
Thanks Given: 28
Thanks Received: 40

Ztrader,

Thanks for the help. I pasted the code into the properties part of the indicator but I got the following errors...how do I get rid of these?

2010-02-17_0652

I've attached the indicator in the original post. Could you insert the code properly and reattach it or tell me how to get rid of these errors?

Thanks,
Todd

Started this thread Reply With Quote
  #7 (permalink)
 
ZTR's Avatar
 ZTR 
 
Experience: Advanced
Platform: NinjaTrader7
Broker: Mirus RCG/Zen-Fire
Trading: CL & 6e, looking at ES, ZB and AU again.
Posts: 2,096 since Nov 2009
Thanks Given: 1,099
Thanks Received: 1,393

I can do this in the afternoon, unless someone else can help Todd sooner?

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #8 (permalink)
 
max-td's Avatar
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
Posts: 1,752 since Jun 2009
Thanks Given: 2,309
Thanks Received: 927

hi todd,
take the stuff you copied in the code off again and try that you get the indicator back to work. this would be the first step.

i think you wish something different than ztrade offered.
i post something the next few minutes.

max-td
Reply With Quote
  #9 (permalink)
 
max-td's Avatar
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
Posts: 1,752 since Jun 2009
Thanks Given: 2,309
Thanks Received: 927

have a look in the cs.code below as example :

you have 2 wavefiles in there wich you are able to define in the variable-section of the indie. i think this is what you look for.

the first snippets you put in #region Variables

 
Code
                            
        #region Variables


        
private string     alertOBStoch    "AlertOBStoch.wav";     // Overbought Alert wav file
        
private string     alertOSStoch    "AlertOSStoch.wav";     // Oversold Alert wav file 
the next is for to put in #region Properties :
 
Code
                            
       #region Properties



        
[Description("Overbought Alert Wav File")]
        [
Category("Alert")]
        public 
string AlertOBStoch
        
{
            
get { return alertOBStoch; }
            
set alertOBStoch value; }
        }    
        
        [
Description("Oversold Alert Wav File")]
        [
Category("Alert")]
        public 
string AlertOSStoch
        
{
            
get { return alertOSStoch; }
            
set alertOSStoch value; }
        } 
then you add alertOSStoch / alertOBStoch instead of the wave-file-definition in your code.
i think its this :

"C:\\Program Files\\NinjaTrader 6.5\\sounds\\testlong.wav" -- now

"alertOSStoch" --- then


i think that does it.


...

max-td
Attached Files
Elite Membership required to download: Stoch_D_Color_Alert.cs
Reply With Quote
Thanked by:
  #10 (permalink)
 
Todd's Avatar
 Todd 
Alpharetta, GA
 
Experience: Intermediate
Platform: ninja
Broker: Mirus / Zenfire
Trading: ES
Posts: 234 since Jun 2009
Thanks Given: 28
Thanks Received: 40


Max,

Thanks for your help.

I tried to copy and paste the code from your indicator into my indicator but I got several syntax errors. I'm guessing there were too many brackets or not enough brackets, etc.

Would you take the indicator that I've attached on the original post below and add your code to so the audio wave file fields will show up on the indicator settings input screen? I'm asking this because I think you will know how to deal with the syntax errors that I ran into.

If you could change the code and reattach it to a new post I would greatly appreciate it.

Todd

Started this thread Reply With Quote




Last Updated on February 26, 2010


© 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