NexusFi: Find Your Edge


Home Menu

 





ADXVMA arrows in Strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Big Mike with 2 posts (1 thanks)
    2. looks_two madLyfe with 2 posts (0 thanks)
    3. looks_3 aslv2000 with 1 posts (0 thanks)
    4. looks_4 hawks67 with 1 posts (1 thanks)
    1. trending_up 4,559 views
    2. thumb_up 2 thanks given
    3. group 5 followers
    1. forum 7 posts
    2. attach_file 0 attachments




 
Search this Thread

ADXVMA arrows in Strategy

  #1 (permalink)
 hawks67 
Chicago, IL
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AGN/Rithmic
Trading: CL
Posts: 22 since Apr 2010
Thanks Given: 14
Thanks Received: 2

Revisiting the ADXVMA (the _ADXVMA_v01_5_2, to be precise) ...I regret that I'm just experienced enough of a programmer to have this make my head hurt...apologies to all if I can't see the forest for the trees...

I've been playing around with the ADXVMA, and want to incorporate certain (but not all) ADXVMA-generated arrows into my strategy, based on other conditions and such.

After looking carefully at the ADXVMA indicator code, I see that it plots an arrow on Bar[1] the instant the first tick of Bar[0] occurs (FirstTickOfBar).
if(FirstTickOfBar) DrawArrowUp(CurrentBar.ToString(), 1, val, _barColorUp);

I suppose my first question would be, what would be the point of using FirstTickOfBar (FTOB) when CalculateOnBarClose (COBC) is set to true up in the Initialize section? The ADXVMA code that does the signal calculation seems to be in the CalculateOnBarClose segment, but the code that does the arrow plotting is occurring within that conditional FirstTickOfBar statement. Why would the logic take place at the close of a bar but the plotting/drawing take place on the opening tick? Aren't the calculations that are made on past closed bars at the open of a new bar the same as calculations made on the same past closed bars at the close of the most recently-closed bar? I suppose where the next bar opens can be different from the previous close and may, in some cases, have an impact on the calculations, but is that the case here?

But more importantly, if a Strategy refers to values assigned in the indicator, how can it be coded to access those values that only exist at FTOB, when the indicator itself is set to COBC? Even if I have the Strategy set to COBC = false, those values just don't make it through. The usual way to do this would be to instantiate the indicators like this:
ADXVMA myADXVMA = ADXVMA(BarsArray[0], 5, true);

and then refer to the indicator's signals using myADXVMA.Signal[0], etc. But this just returns zeroes. The value in Signal[0] at the time the Strategy references it (and it doesn't matter if the Strategy is COBC or not) is not the value assigned at the time of the indicator's FTOB variable-assignments, a fact which is made clear by the fact that the arrow paints but the variable - pulled directly from the array - stays at 0. It's obvious that the variable pulled from the array is from a point in time after the FTOB assignment, I'm assuming at OnBarClose?

I know this is a long and rambling post, but I wanted to be clear; the ADXVMA plots an arrow at the FTOB, based on calculations that were made on COBC. How can I have a Strategy (COBC or otherwise) "get wind" of this ADXVMA FTOB value? How can I get a trigger that will fire in my Strategy in synchronization with the painting of the arrow?

Thank you in advance for indulging me,
Gary

Started this thread Reply With Quote
Thanked by:

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
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
Quant vue
Trading Reviews and Vendors
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #3 (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 Gary,
interesting topic - i also wait about some ideas
i have no solution to offer but i push it up again - maybe we get some inputs !

last year we had lots of discussions about ADXVMA here and it never was clear whats up with this thing somehow.
there are diff versions arround etc.

but you Question now belongs to the first-tickof-bar-topic - so thats a bit different i think.

wouldnt it be easier to catch the barclose for your trigger ?
it shouldnt be much different



max-td
Reply With Quote
  #4 (permalink)
 aslv2000 
Bogota, Colombia, South Americ
 
Experience: Intermediate
Platform: NinjaTrader
Posts: 12 since Nov 2009
Thanks Given: 4
Thanks Received: 1

Hi.... I have noticed an issue with the ADXVMA v01.5.2. When the OnBarClose is set to false, sometimes it draws arrows in real time correctly and sometimes the arrows appear after hitting F5 (reloading historical data), obviously after the setup is no longer useful.

Do you know who can address this issue to correct or explain the cause?

Thank you.

Reply With Quote
  #5 (permalink)
 
madLyfe's Avatar
 madLyfe 
Des Moines, Iowa
 
Experience: None
Platform: Ninja, TOS
Broker: AMP/CQG, TOS
Trading: CL, TF, GC
Posts: 1,641 since Feb 2011
Thanks Given: 9,220
Thanks Received: 1,020

i am also noticing this issue.. any of the pros have any idea?

dont believe anything you hear and only half of what you see

¯\_(ツ)_/¯

(╯°□°)╯︵ ┻━┻
Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662

This may apply -- if you set an indicator COBC = false, then a condition that may have been true during the creation of the bar (intrabar), such as a condition that would cause an arrow to be painted, may no longer be true at the end of the bar.

For example, if a bar has 500 ticks in it (regardless of bar type), then during one of those 500 ticks the condition that triggers drawing the arrow may have been true. But at the end of the bar, it was no longer true.

So when you load an indicator on a chart for the first time, each bar is calculated COBC=true. Even if you set "COBC=false", NT will calculate historical data/indicators as COBC=true. On the same token, if you press F5 to refresh data, you will see the result of COBC=true calculated data only.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
 
madLyfe's Avatar
 madLyfe 
Des Moines, Iowa
 
Experience: None
Platform: Ninja, TOS
Broker: AMP/CQG, TOS
Trading: CL, TF, GC
Posts: 1,641 since Feb 2011
Thanks Given: 9,220
Thanks Received: 1,020


Big Mike View Post
This may apply -- if you set an indicator COBC = false, then a condition that may have been true during the creation of the bar (intrabar), such as a condition that would cause an arrow to be painted, may no longer be true at the end of the bar.

For example, if a bar has 500 ticks in it (regardless of bar type), then during one of those 500 ticks the condition that triggers drawing the arrow may have been true. But at the end of the bar, it was no longer true.

So when you load an indicator on a chart for the first time, each bar is calculated COBC=true. Even if you set "COBC=false", NT will calculate historical data/indicators as COBC=true. On the same token, if you press F5 to refresh data, you will see the result of COBC=true calculated data only.

Mike

ya i kinda understand.. i guess i like the way it works(still testing) while in COBC=false, but is there a way to get the arrows/alerts to signal that change when the bar officially closes? see this indie seems to be two bars behind when COBC=true.. if it wasnt doing that i wouldnt really have a problem using the COBC=true since my strategy works with waiting for bars to complete before entry..

dont believe anything you hear and only half of what you see

¯\_(ツ)_/¯

(╯°□°)╯︵ ┻━┻
Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662


madLyfe View Post
ya i kinda understand.. i guess i like the way it works(still testing) while in COBC=false, but is there a way to get the arrows/alerts to signal that change when the bar officially closes? see this indie seems to be two bars behind when COBC=true.. if it wasnt doing that i wouldnt really have a problem using the COBC=true since my strategy works with waiting for bars to complete before entry..

I can't help much with this any longer beyond what I've said already, will need to find another NT programmer. I'm sure one will come to the rescue soon enough





Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on November 2, 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