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:	225
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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    132 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    65 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X