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:	229
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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    163 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    82 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    125 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    206 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    185 views
    0 likes
    Last Post CarlTrading  
    Working...
    X