Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Darvas Strategy Errors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Darvas Strategy Errors

    Hey, I'm trying to use Darvas in a strategy, however I can't even get the first Darvas condition working correctly. I'm trying to make a short order when the upper and lower of Darvas is less than the previous bar of upper and lower of Darvas. The strategy is placing the orders right but its also adding orders that do the opposite. Any advice? Here is the code I using and a example of the errors.
    Thank you for your time and help!

    If
    (Darvas1.Upper[0]<Darvas1.Upper[1]) &&(Darvas1.Lower[0]<Darvas1.Lower[1])
    then
    short order..
    ​​​​​​​Click image for larger version

Name:	darvas help.png
Views:	213
Size:	354.4 KB
ID:	1046657

    #2
    Hello xNICK,

    Thanks for your post.

    As a first step to understanding what is happening and why we recommend debugging your strategy by using print statements. To validate the logic you are using, print out all values being used such as Darvas1.Upper[0], Darvas1.Upper[1], etc. etc. In this way, you will see what values the logic is working with and you can diagnose further from there. Here is a link to our debugging tips: https://ninjatrader.com/support/help...script_cod.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    111 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    59 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    38 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    41 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    78 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X