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:	216
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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    43 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    29 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    46 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X