Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple Modification to Buy/Sell Buttons

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

    Simple Modification to Buy/Sell Buttons

    Hello community,

    I am looking for a simple way to modify the existing chart trader buy/sell buttons such that when a button click is registered, rather than immediately submitting, the order will delay until the close of the candle.

    Generally, how can I add logic to the click of these particular buttons. Just to catch any prospective help up on where I am so far, I have downloaded NT_Chelsea's wonderful indicators that allow one to modify the existing chart trader buttons (in the form of an indicator) but I was unable through searching to determine how to actually change the logic of a button click and send an order (especially in the context of the original indicator)...

    I am also aware of a strategy which adds buy/sell buttons to the rendered chart directly. This approach turns out to be problematic for me due to the way the strategy interacts with manually closing/opening positions.

    TL;DR How can I add custom logic to the existing chart trader buttons such that the submission of orders can be modified? Syntax for order submission within this context? ATM approach? managed? unmanaged? account.submit?

    Thank you!

    #2
    Hello lunardiplomacy,

    Thanks for your post.

    I would suggest using Chelsea's scripts to get started, and then I would consider hiding those buttons and adding your own in their place.

    For example, you could do the following to hide a button and then add a button on top of those buttons in that button's place.

    Code:
    if (buyMarketButton != null)
        buyMarketButton.Visibility = Visibility.Hidden;
    I would then suggest using AddOn framework code to submit orders directly from the account. Account.Submit can be used to submit orders and StartAtmStrategy can be used to submit orders with an ATM strategy.

    The script I have attached can be used to demonstrate order submissions with AddOn Framework code once the indicator holding the AddOn Framework code is added to the chart.

    Please see the Account class for further details on Account.Submit and and StartAtmStrategy.

    Account Class - https://ninjatrader.com/support/help...ount_class.htm

    StartAtmStrategy - https://ninjatrader.com/support/help...tmstrategy.htm

    For the thread's reference, NinjaTrader_Chelsea's Chart Trader modification examples can be found here - https://ninjatrader.com/support/foru...considerations

    We look forward to assisting.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Hey Jim, thanks for getting back to me.

      I have the code up for the indicator you sent me and it's already useful inasmuch as linking an account is concerned, however I would appreciate clarification on two things...

      I am running a playback connection with your indicator. What exactly am I supposed to be seeing? I am trying to read quickly because I know you guys are probably calling it quits for the day soon, but my understanding is that you can click on the price scale to set a limit order after comparing the price clicked with the current close or something? Just asking for an overview of this indicator so I know what everything is doing and then I can start working to modify it.

      Secondly, you suggested that I hide chelsea's buttons in the (i assume we're talking about the same indicator, that would be ChartTraderModifyExistingButtons) indicator, and I'm sure that is a worthwhile suggestion, but can you clarify why that would be necessary? why can't I just alter chelsea's buttons?

      Thanks again for getting back to me. Sorry if I missed anything obvious, like I said, reading quickly.

      Comment


        #4
        Just for the sake of paring down.. since I was in playback I needed to change the account name. Jim this functionality should just be the vanilla method for placing limit orders, it's great.

        I would still like to understand your first suggestion about hiding and overlapping buttons, but based upon this indicator I think I know what I need to do now.

        Thank you.

        Comment


          #5
          Hello lunardiplomacy,

          My example indicator shows orders submissions with AddOn Framework code when you click on a chart.

          I would suggest hiding the buttons and then re-adding your own, because it would be easier to create a new button who's Click event does not have an event handler subscribed than to attempt to unsubscribe an event handler that is internal and not publicly known. Once you create your own button, you can assign your own event handlers. Chelsea's ChartTraderModifyExistingButtonsExample example adds an event handler to display text on the chart, but the original event handlers for order submissions are still subscribed to the existing buttons.

          Let us know if you have any additional questions.
          JimNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by pdennis, Today, 07:43 AM
          0 responses
          1 view
          0 likes
          Last Post pdennis
          by pdennis
           
          Started by b16_aln, Today, 05:15 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Negustrader, Today, 01:01 AM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by soon123, Yesterday, 10:50 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by liadmz, Yesterday, 03:39 PM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X