NexusFi: Find Your Edge


Home Menu

 





A little programming help plz


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one mpe66 with 15 posts (1 thanks)
    2. looks_two MooreTech with 5 posts (1 thanks)
    3. looks_3 gregid with 5 posts (1 thanks)
    4. looks_4 Zondor with 3 posts (8 thanks)
      Best Posters
    1. looks_one Zondor with 2.7 thanks per post
    2. looks_two gregid with 0.2 thanks per post
    3. looks_3 MooreTech with 0.2 thanks per post
    4. looks_4 mpe66 with 0.1 thanks per post
    1. trending_up 10,635 views
    2. thumb_up 11 thanks given
    3. group 5 followers
    1. forum 31 posts
    2. attach_file 6 attachments




 
Search this Thread

A little programming help plz

  #1 (permalink)
 mpe66 
Sweden
 
Experience: Intermediate
Platform: NinjaTrader
Posts: 49 since Mar 2010
Thanks Given: 29
Thanks Received: 12

I'm trying to create a VWAP Oscillator in NT7 and thought I'd use the NT indicator Volume Oscillator as a template.
The Volume Oscillator code looks like this:

{
Value.Set(SMA(Volume, Fast)[0] - SMA(Volume, Slow)[0]);
}

I need to have my indicator calculate:

((Current Price) - (VWAP plot of VWAP indicator)) / (("SD1 Upper" plot of VWAP indicator) - (VWAP plot of VWAP indicator))

Which I thought would be:

{
Value.Set (((Close[0]) - (VWAP.WVAP[0])) / ((VWAP.SD1 Upper[0]) - (VWAP.VWAP[0])));
}

But I get a bunch of errors like ) expected and statement expected. Can anyone see where I went wrong? Would the "SD1 Upper" plot of VWAP indicator be VWAP.SD1 Upper[0]?

I'm obviously no programming savant and would appreciate all help on this,

Mpe

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
Exit Strategy
NinjaTrader
MC PL editor upgrade
MultiCharts
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
22 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 650 since Aug 2009
Thanks Given: 320
Thanks Received: 623


Ther is no space in the name of the DataSeries - it should be:
SD1Upper (no space)

Reply With Quote
  #4 (permalink)
 mpe66 
Sweden
 
Experience: Intermediate
Platform: NinjaTrader
Posts: 49 since Mar 2010
Thanks Given: 29
Thanks Received: 12


gregid View Post
Ther is no space in the name of the DataSeries - it should be:
SD1Upper (no space)

Thanks, that fixed the errors. But I get new ones when I try to compile, "NinjaTrader.Indicator.Indicator.VWAP() is a method which is not valid in the given context."

Any thoughts one this one?



Started this thread Reply With Quote
  #5 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 650 since Aug 2009
Thanks Given: 320
Thanks Received: 623

Posting original VWAP indicator might help.

For now: are you sure there is a dataseries like VWAP in the original indicator? The indicator I've seen has VWAPLine as the name of the main plot. Try replacing VWAP[0] with VWAPLine[0]

Reply With Quote
  #6 (permalink)
 MooreTech 
Orlando, Florida
 
Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Trading: ES
Posts: 57 since Aug 2010
Thanks Given: 6
Thanks Received: 73


mpe66 View Post
I'm trying to create a VWAP Oscillator in NT7 and thought I'd use the NT indicator Volume Oscillator as a template.
The Volume Oscillator code looks like this:

{
Value.Set(SMA(Volume, Fast)[0] - SMA(Volume, Slow)[0]);
}

I need to have my indicator calculate:

((Current Price) - (VWAP plot of VWAP indicator)) / (("SD1 Upper" plot of VWAP indicator) - (VWAP plot of VWAP indicator))

Which I thought would be:

{
Value.Set (((Close[0]) - (VWAP.WVAP[0])) / ((VWAP.SD1 Upper[0]) - (VWAP.VWAP[0])));
}

But I get a bunch of errors like ) expected and statement expected. Can anyone see where I went wrong? Would the "SD1 Upper" plot of VWAP indicator be VWAP.SD1 Upper[0]?

I'm obviously no programming savant and would appreciate all help on this,

Mpe

I don't have the VWAP indicator, so it's a little difficult to tell for sure. Some possibilities:

{
Value.Set (((Close[0]) - (VWAP.WVAP[0])) / ((VWAP.SD1 Upper[0]) - (VWAP.VWAP[0])));
}

Most indicators require parameters. Are you sure you aren't supposed to pass some parameters to the indicator? (ie. VWAP(Period).VWAP[0])

Follow me on Twitter Reply With Quote
  #7 (permalink)
 hegh 
paris
 
Experience: None
Platform: NinjaTrader
Posts: 60 since Oct 2009
Thanks Given: 1
Thanks Received: 54

hi,

Current Price= Close[0]

VWAP plot of VWAP indicator = VWAP().VWAPLine[0]

SD1 Upper" plot of VWAP indicator = VWAP().SD1Upper[0]

SD1 Lower" plot of VWAP indicator = VWAP().SD1Lower[0]

etc...

Reply With Quote
  #8 (permalink)
 mpe66 
Sweden
 
Experience: Intermediate
Platform: NinjaTrader
Posts: 49 since Mar 2010
Thanks Given: 29
Thanks Received: 12

I'm using the indicator from post 258 in this thread on the NT forum. I'm pretty sure the name of the plot is just VWAP or at least that's what it's called in the indicator settings. As for parameters there are couple. Start time, end time, Accuracy warning (true/false), Std Dev calc mode ( VWAP/VWAPavg) etc. Would I need to insert all that in my script?

Started this thread Reply With Quote
  #9 (permalink)
 MooreTech 
Orlando, Florida
 
Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Trading: ES
Posts: 57 since Aug 2010
Thanks Given: 6
Thanks Received: 73


mpe66 View Post
I'm using the indicator from post 258 in this thread on the NT forum. I'm pretty sure the name of the plot is just VWAP or at least that's what it's called in the indicator settings. As for parameters there are couple. Start time, end time, Accuracy warning (true/false), Std Dev calc mode ( VWAP/VWAPavg) etc. Would I need to insert all that in my script?

Yes. It should look something like this:

VWAP(startTime,endTime,true.... )[0]

or

VWAP(startTime,endTime,true.... ).SD1Upper[0]

Follow me on Twitter Reply With Quote
  #10 (permalink)
 mpe66 
Sweden
 
Experience: Intermediate
Platform: NinjaTrader
Posts: 49 since Mar 2010
Thanks Given: 29
Thanks Received: 12



MooreTech View Post
Yes. It should look something like this:

VWAP(startTime,endTime,true.... )[0]

or

VWAP(startTime,endTime,true.... ).SD1Upper[0]

Ok I tried inputting all the settings and got:

Value.Set (((Close[0]) - (VWAP(00:00:00, 00:00:00, False, True, VWAP,1).VWAP[0])) / ((VWAP(00:00:00, 00:00:00, False, True, VWAP,1).SD1Upper[0]) - (VWAP(00:00:00, 00:00:00, False, True, VWAP,1).VWAP[0])));

But get a bunch of errors. It doesn't seem to like ":" and expects a bunch of ";".

Started this thread Reply With Quote




Last Updated on July 27, 2011


© 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