NexusFi: Find Your Edge


Home Menu

 





'ProjectHigh' and 'ProjectLow': grabbing them


Discussion in NinjaTrader

Updated
    1. trending_up 1,618 views
    2. thumb_up 1 thanks given
    3. group 1 followers
    1. forum 5 posts
    2. attach_file 1 attachments




 
Search this Thread

'ProjectHigh' and 'ProjectLow': grabbing them

  #1 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184

The Donchian Channel indicator was created by Richard Donchian. It uses the highest high and the lowest low of a period of time to plot the channel. The Donchian Channel Expansion/Contraction Ratio indie was written by cclsys (who hasnt been on the forums lately: I miss his posts) and does a projection of the channel which are ouputted as 'ProjectHigh' and 'ProjectLow'. What I would like to do is 'capture' those two values to use them in a strategy. Unfortunately I am lacking in insight into the correct way to do it efficiently.

First off, I dont want the values of 'ProjectHigh' and 'ProjectLow' as at a # of 'barsago' : I need the last few 'ProjectHigh' and 'ProjectLow' values which might have been spread out over 20 or more bars: one use would be a chop tool to see how much the values are 'stepping' from the second previous value of 'ProjectHigh' or 'ProjectLow' to the most recent value of 'ProjectHigh' and 'ProjectLow' etc: on the image are the values of three 'ProjectLow' that are representing 4 range bars of travel.

Can any kind soul at least 'notepad' what code would be best to use. I thanks much in advance for code contributions.

Image attached as it easier to show than tell lol

Trader.Jon

Attached Thumbnails
Click image for larger version

Name:	'ProjectHigh' and 'ProjectLow'.jpg
Views:	237
Size:	176.0 KB
ID:	16706  
Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
 
  #3 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844


I am not a very good programmer, but I think you want the following,

High[HighestBar(High, 20)] or

Low[LowestBar(Low, 20)]

Someone correct me if that is wrong.

Reply With Quote
  #4 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184

Thanks for the input. I did manage to find a way to do it, but I feel that there has to be a more efficient way.

protected override void OnBarUpdate()
{
double _phibk0 = DRC(200, true, dRC_period).ProjectHigh[0];
double _phibk1 = DRC(200, true, dRC_period).ProjectHigh[1];
double _phibk2 = DRC(200, true, dRC_period).ProjectHigh[2];
double _plobk0 = DRC(200, true, dRC_period).ProjectLow[0];
double _plobk1 = DRC(200, true, dRC_period).ProjectLow[1];
double _plobk2 = DRC(200, true, dRC_period).ProjectLow[2];


// LONG Entry Condition 1:
if ( entryOrder1 == null && entryOrder2 == null
// Enters long limit order when DRC projecthigh has two steps up
&& _phibk0 > _phibk1 && _phibk1 > _phibk2

Jon


vegasfoster View Post
I am not a very good programmer, but I think you want the following,

High[HighestBar(High, 20)] or

Low[LowestBar(Low, 20)]

Someone correct me if that is wrong.


Started this thread Reply With Quote
  #5 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184

So I did manage to get my calculations from the data but I cant figure how to plot a double value that I ended up with:

double _sUM_diff = (_sUM_diff12 - _sUM_diff7)(0);

Getting method name errors when this is tried
Add(new Plot(Color.Orange, "_sUM_diff"));

and also tried variations of this with errors in 'variables' and 'method' from the NT6.5 help files
Add(_sUM_diff(0));

Obviously I am not seeing what I should.

Any input is appreciated,
Jon

Started this thread Reply With Quote
  #6 (permalink)
 
Trader.Jon's Avatar
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
Posts: 473 since Jul 2009
Thanks Given: 401
Thanks Received: 184

I thought I had something working , but when I tried to run the compiled strategy it wont show any trades... when I take out all the 'double's I put in the strategy runs and shows trades.. back to the drawing board with no idea how to make it work ... any code gurus able to take a stab at this please?

Jon

Started this thread Reply With Quote




Last Updated on July 13, 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