Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Using "Signal Name" as Input?

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

    Using "Signal Name" as Input?

    Hi,
    I'd like to be able to create a rule that prevents the next trade if the last historical trade was a "Stop Loss".
    Rough logic being something like:

    Last "Exit Name" does not equal "Stop Loss"
    or
    Last:SignalName:ExitName:StopLoss = False.

    Is there a simple way to access this? Is there a different way to accomplish this goal?

    Thanks for any ideas - Marcus

    #2
    Hello mazcis,

    Thank you for your note.

    For something like this, you'd need to manually code the strategy, just in case you're using the Builder currently.

    I think the best route here would be create a bool set to true, and to monitor in OnExecutionUpdate for when you have an order come in that has a status of filled or partially filled that also has the same signal name you've set for your stop loss, and if it it does match, set the bool to false, and if any other kind of order comes in, set it to true.

    You could then check the bool in On Bar Update in your conditions for entry, and not allow entry if the bool is false. You'd probably want more logic to reset it to true if conditions look right to reallow trading, or it would just cease trading at the point that the bool becomes false.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Option Whisperer, Today, 09:55 AM
    1 response
    11 views
    0 likes
    Last Post bltdavid  
    Started by port119, Today, 02:43 PM
    0 responses
    1 view
    0 likes
    Last Post port119
    by port119
     
    Started by Philippe56140, Today, 02:35 PM
    0 responses
    3 views
    0 likes
    Last Post Philippe56140  
    Started by 00nevest, Today, 02:27 PM
    0 responses
    2 views
    0 likes
    Last Post 00nevest  
    Started by Jonafare, 12-06-2012, 03:48 PM
    5 responses
    3,986 views
    0 likes
    Last Post rene69851  
    Working...
    X