Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    79 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X