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

Chart Trader Rev Button to custom buttons

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

    Chart Trader Rev Button to custom buttons

    Hello everyone, I'm looking for an opportunity to access the command from the trader's chart to the Rev button
    This is the button that flips the position to the other side of the open

    In other words, I want to connect the ability to flip position to my custom buttons

    for example, this is how this command closes all orders:

    account.Flatten(new[] { Cbi.Instrument.GetInstrument(Instrument.FullName) });

    i need something similar to turn the position to the other side

    How can i do this?

    what syntax?
    Last edited by memonolog; 08-04-2021, 08:10 AM.

    #2
    Hello memonolog,

    Thank you for your post.

    There wouldn't be a specific method that would simply reverse the position, you'd have to create your own logic to grab the instrument position and current quantity, then submit an appropriate order to close and an order to reverse the position when the button is pressed.

    Account.Position: https://ninjatrader.com/support/help...ns_account.htm
    Account.CreateOrder: https://ninjatrader.com/support/help...reateorder.htm
    Account.Submit: https://ninjatrader.com/support/help...nt8/submit.htm

    I've created a simple example indicator script that adds three buttons to the top of the chart window. Clicking the Long or Short buttons will enter or exit a long or short position, while clicking the REV button will reverse an open position.

    Please let us know if we may be of further assistance to you
    Attached Files
    Last edited by NinjaTrader_Kate; 08-04-2021, 09:42 AM.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by TraderJA, Today, 12:06 AM
    0 responses
    4 views
    0 likes
    Last Post TraderJA  
    Started by SnailHorn, Yesterday, 10:49 PM
    0 responses
    7 views
    0 likes
    Last Post SnailHorn  
    Started by naanku, Yesterday, 07:25 PM
    0 responses
    8 views
    0 likes
    Last Post naanku
    by naanku
     
    Started by milfocs, Yesterday, 07:23 PM
    0 responses
    6 views
    0 likes
    Last Post milfocs
    by milfocs
     
    Started by PaulMohn, Yesterday, 06:59 PM
    0 responses
    8 views
    0 likes
    Last Post PaulMohn  
    Working...
    X