Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Remove SLM orders

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

    Remove SLM orders

    I got a script here from good 'ole Leeroy Jenkins and am trying to tailor it to my needs. So far I've been successful at EnterLongStopLimit() and EnterShortStopLimit to show up where I want them to. But the script doesn't execute the order to ExitLong() or ExitShort(). For example, I press the button to go long SLM a tick above bar close. The order shows up. But let's say before the bar closes I change my mind. Clicking the button to then exit doesn't work. Maybe I have the wrong command/syntax or whatever it's called?

    Below is some of the code. Thanks for any direction you can give me.

    {
    if (longButtonClicked)
    EnterLongStopLimit(Convert.ToInt32(1), Open[0] + (7 * TickSize), Open[0] + (7 * TickSize));

    if (shortButtonClicked)
    EnterShortStopLimit(Convert.ToInt32(1), Open[0] + (-7 * TickSize), Open[0] + (-7 * TickSize));

    if (!longButtonClicked)
    ExitLong();
    if (!shortButtonClicked)
    ExitShort();
    }

    #2
    Hi inthemoney, the ExitLong/ExitShort methods will not exit a position if one does not exist. You need to click the x symbol on the limit/stop order that is resting on the chart to cancel it. Turn on Chart Trader on the chart to see the orders.

    Kind regards,
    -ChrisL

    Comment

    Latest Posts

    Collapse

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