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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    90 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X