NexusFi: Find Your Edge


Home Menu

 





Darvas Indicator


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one gretzkyless with 5 posts (11 thanks)
    2. looks_two cory with 4 posts (14 thanks)
    3. looks_3 eensor with 2 posts (1 thanks)
    4. looks_4 kennanoate with 2 posts (0 thanks)
      Best Posters
    1. looks_one Fat Tails with 4 thanks per post
    2. looks_two cory with 3.5 thanks per post
    3. looks_3 gretzkyless with 2.2 thanks per post
    4. looks_4 djiym with 1 thanks per post
    1. trending_up 15,653 views
    2. thumb_up 31 thanks given
    3. group 12 followers
    1. forum 15 posts
    2. attach_file 16 attachments




 
Search this Thread

Darvas Indicator

  #1 (permalink)
 
gretzkyless's Avatar
 gretzkyless 
Chicago, IL/USA
 
Experience: Intermediate
Platform: Ninja Trader
Broker: AMP Trading - CQG/ThinkorSwim
Trading: Futures
Posts: 30 since Jan 2013
Thanks Given: 13
Thanks Received: 19

This is a general question regarding indicators, but wanted to find out why someone couldn't just combine 2 of the indicators into one. For instance, I was trying to combine the Darvas and DynamicSRLines indicators into one indicator and wondering why it wouldn't be as simple as combining the code together into one. When I moved the 'variables' and 'properties' of one indicator over into the other indicator and compile, I get no errors, but when I move the 'OnBarUpdate' information over, I get errors, most pertaining to error code CS1519.

I'm new to coding and don't know how the syntax works well, but was trying to figure out why consolidating the code into one indicator doesn't work like I thought it would.

My rationale for trying to combine the 2 indicators was to figure out how to draw a Darvas box around a resting period to set-up for a possible trade up or down. I couldn't find an indicator that did this, and was trying to figure out a way to show this without the continuous drawing. I have included 2 examples of what I'm trying to accomplish.

I'm aware that more would need to be done to fine tune the indicator, but just trying to get this to draw boxes around resting periods, sideways areas. Any advice or help in pointing me in the direction to create this indicator would be greatly appreciated. Thanks.

Below are my parameters based on trading crude:

1) Once Equal or Lower highs are created, begin creating box at first equal or lower high if at least the next 3 bars are formed fit this criteria.
2) Minimum number of ticks to start creating box - 10 ticks
3) Maximum number of ticks to start creating box - 25 ticks
4) Mark the boxes high or low point if the next 3 bars make LH/HL
5) Once the next bar breaks above/below the box, signal long/short trade.

I'm just trying to make the Ninja Darvas indicator a little less noisy.

Attached Thumbnails
Click image for larger version

Name:	CLDarvas Indicator.jpg
Views:	776
Size:	30.4 KB
ID:	100704   Click image for larger version

Name:	CLIndicator I Want.jpg
Views:	838
Size:	39.1 KB
ID:	100705   Click image for larger version

Name:	CLDarvas Indicator2.jpg.png
Views:	662
Size:	22.9 KB
ID:	100706   Click image for larger version

Name:	CLIndicator I Want2.png
Views:	647
Size:	40.7 KB
ID:	100707  
Attached Files
Elite Membership required to download: Darvas Boxes per Ninja Indicator.docx
Elite Membership required to download: Darvas Boxes per Ninja Indicator2.docx
Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
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
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090

sample of merging darvas with srline, you just need to remember to re-number value[0],value[1] so they don't use the same array.

Attached Files
Elite Membership required to download: DavasAndSRLines.cs
Reply With Quote
  #3 (permalink)
 
gretzkyless's Avatar
 gretzkyless 
Chicago, IL/USA
 
Experience: Intermediate
Platform: Ninja Trader
Broker: AMP Trading - CQG/ThinkorSwim
Trading: Futures
Posts: 30 since Jan 2013
Thanks Given: 13
Thanks Received: 19


Hey Cory. Thanks for the attachment. I just have one question about the attachment since I'm still trying to understand how to look at and create code Was I suppose to change the value portion of the code based on the indicator you attached or did you do that when you inputted the value [2] and value [3] sections to the region variable code? I'm just wondering if there was something still needing to be done since when I tried to compile the code to add to my indicators, I still got the CS1519 error for the bottom portion of the OnBarUpdate section. I have attached a screenprint so you can see what I'm referring to. Thanks again for helping me get started on what I'm trying to create.

Attached Thumbnails
Click image for larger version

Name:	IndicatorError.jpg
Views:	388
Size:	142.4 KB
ID:	100738  
Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #4 (permalink)
 
gretzkyless's Avatar
 gretzkyless 
Chicago, IL/USA
 
Experience: Intermediate
Platform: Ninja Trader
Broker: AMP Trading - CQG/ThinkorSwim
Trading: Futures
Posts: 30 since Jan 2013
Thanks Given: 13
Thanks Received: 19

My apologies. The indicator does work, but didn't plot the SR Lines. I will work on it tomorrow to see if I can get the SR Lines to show up when the indicator is running. Thanks again for your help and getting me started in what I'm trying to do.

Follow me on Twitter Started this thread Reply With Quote
  #5 (permalink)
 Hguru 
New York City New York USA
 
Experience: Intermediate
Platform: Think or Swim, Infinity Futures
Broker: Thinkor Swim for Charts an Infinity Futures for Trading Dom
Trading: Oil
Posts: 54 since Jul 2012
Thanks Given: 449
Thanks Received: 48

Gretzyless,

I feel your pain that he is not playing anymore he was the greatest I have ever seen....

I like your study...

Can anyone program this for TOS

Thanks

Hguru

Reply With Quote
  #6 (permalink)
 
gretzkyless's Avatar
 gretzkyless 
Chicago, IL/USA
 
Experience: Intermediate
Platform: Ninja Trader
Broker: AMP Trading - CQG/ThinkorSwim
Trading: Futures
Posts: 30 since Jan 2013
Thanks Given: 13
Thanks Received: 19

Ok. Now that I got some sleep, I can see what my confusion was last night in not seeing the indicator on my chart. I have attached a screenprint of the SRLines indicator I was trying to combine with the Darvas Box Indicator. I have also included the SRLines Indicator as well.

Attached Thumbnails
Click image for larger version

Name:	Crude 5-Minute Chart.jpg
Views:	716
Size:	75.9 KB
ID:	100759  
Attached Files
Elite Membership required to download: DynamicSRLines.zip
Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090

daynamicSR is more complex so I copy darvas code to dynamicSR, the is no value[0]..etc in SR so I don't have to change any number. Only thing you have to pay attention is in copying the whole #region over make sure the structure still looks the same, use +/- sign next to #region to maximize/minimize them to see which is where.

Attached Files
Elite Membership required to download: DynamicSRandDarvas.cs
Reply With Quote
Thanked by:
  #8 (permalink)
 
gretzkyless's Avatar
 gretzkyless 
Chicago, IL/USA
 
Experience: Intermediate
Platform: Ninja Trader
Broker: AMP Trading - CQG/ThinkorSwim
Trading: Futures
Posts: 30 since Jan 2013
Thanks Given: 13
Thanks Received: 19

Thank you very much for your help again. It looks great. Now I just have to get the Darmas Boxes to plot like the boxes I created. I took the 2 positions in CL in the SIM account based on the indicators I have included and got 50+ tick runs in both directions. I have included the screen print for everyone's review. Thanks again, you rock.

Attached Thumbnails
Click image for larger version

Name:	CL 5-Min Chart.jpg
Views:	856
Size:	100.5 KB
ID:	100786  
Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #9 (permalink)
 eensor 
New Braunfels, TX
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Zen-Fire
Trading: futures
Posts: 129 since Aug 2009
Thanks Given: 924
Thanks Received: 21


cory View Post
daynamicSR is more complex so I copy darvas code to dynamicSR, the is no value[0]..etc in SR so I don't have to change any number. Only thing you have to pay attention is in copying the whole #region over make sure the structure still looks the same, use +/- sign next to #region to maximize/minimize them to see which is where.

Hi Cory,

Thanks for the hard work you do. Is it possible to code the green and red S/R lines in this indicator to where they don't repaint?

Thanks again,
eensor

Reply With Quote
  #10 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090



eensor View Post
Hi Cory,

Thanks for the hard work you do. Is it possible to code the green and red S/R lines in this indicator to where they don't repaint?

Thanks again,
eensor

in order to look like a fantastic indicator it has to adjust/repaint to accommodate new high, new low as market prints more and more bars, nothing to do.

Reply With Quote
Thanked by:




Last Updated on December 25, 2021


© 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