• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

3 day Low Exit

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

    3 day Low Exit

    hi all - new to NJ scripting and perplexed with folloiwng

    trying to exit any long trades for when the current low is below the lowest low for the previous 3 days - following my script:

    if ((Low[0]) <= (MIN(Low, 3)[1]))
    {
    ExitLong("", "out-L(p)");
    }

    when i run the script (and print out the necessary numbers), the script enters a Long position, however does not exit as expected on a bar where the low is clearly below the min of the following 3 days low (the printed out numbers suggest that the condition is true, current low below MIN).

    the system behaves as expected for any Short trades where i have something similar (current High above max of previous 3 day highs)

    any suggestions as to what i am doing wrong is very much appreciated - thanking you in advance; cheers...

    ...jurgen
    Attached Files

    #2
    Originally posted by jurgenC View Post
    hi all - new to NJ scripting and perplexed with folloiwng

    trying to exit any long trades for when the current low is below the lowest low for the previous 3 days - following my script:

    if ((Low[0]) <= (MIN(Low, 3)[1]))
    {
    ExitLong("", "out-L(p)");
    }

    when i run the script (and print out the necessary numbers), the script enters a Long position, however does not exit as expected on a bar where the low is clearly below the min of the following 3 days low (the printed out numbers suggest that the condition is true, current low below MIN).

    the system behaves as expected for any Short trades where i have something similar (current High above max of previous 3 day highs)

    any suggestions as to what i am doing wrong is very much appreciated - thanking you in advance; cheers...

    ...jurgen
    Hard to say without seeing more of the code. Are you sure that you have used the correct EntrySignal name to tie to the ExitLong() order?

    Comment


      #3
      hi koganam - thanks (i just worked it out due to your post)

      need to change ExitLong("", "out-L(p)"); to ExitLong("out-L(p)", "");

      cheers - jurgen

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Gerik, Today, 10:58 PM
      0 responses
      1 view
      0 likes
      Last Post Gerik
      by Gerik
       
      Vps by stooby
      Started by stooby, Today, 08:32 PM
      0 responses
      11 views
      0 likes
      Last Post stooby
      by stooby
       
      Started by FaaastEddy, Today, 08:25 PM
      0 responses
      3 views
      0 likes
      Last Post FaaastEddy  
      Started by YevhenShynkarenko, Yesterday, 01:22 AM
      2 responses
      39 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by testingsarasa, 05-20-2018, 02:50 PM
      11 responses
      739 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X