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:	237
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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    7 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    59 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    41 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    47 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    38 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X