Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart trading from charts with "one click"

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

    #31
    dominikbritz

    Thank you for your help. This new version is working well. No phantom orders or orphaned orders.

    If I may suggest something to reduce our cognitive load. Would it be possible to use the same button for to enter limit buys and limit sells? For example, if price is above the limit order, it would automatically be entered as a limit buy. If price is below the limit order, it would be automatically be entered as a limit sell.

    This would eliminate the need for our brain to decide whether to press the Alt or Shift key.

    Thank you for considering my suggestion.


    Comment


      #32
      No, I prefer two buttons. But the code is free, you can change it to your liking anytime.

      Comment


        #33
        HI
        #dominikbritz nice piece of coding - significant improvement upon mine - thanks for the credit though.

        oldporkchops - not sure why you would do this but

        Alter the buy button to the following

        Code:
                            if (buyButton == true)
                            {
                                try
                                {
                                if (priceClicked > GetCurrentAsk())//Close[0])
                                {    
                                    myOrder = myAccount.CreateOrder(Instrument, OrderAction.Buy, orderType, OrderEntry.Manual, TimeInForce.Day, myQuantity, priceClicked, priceClicked, "", "Entry", DateTime.MaxValue, null);        
                                }
                                else if (priceClicked < GetCurrentBid())//Close[0])
                                {
                                    myOrder = myAccount.CreateOrder(Instrument, OrderAction.Sell, OrderType.StopLimit, OrderEntry.Manual, TimeInForce.Day, myQuantity, priceClicked, priceClicked, "", "Entry", DateTime.MaxValue, null);
                                }
                                }
                                catch ( Exception d)
                                {
                                    // Submits an entry into the Control Center logs to inform the user of an error                
                        Log("SampleTryCatch Error: Please check your indicator for errors.", NinjaTrader.Cbi.LogLevel.Warning);
        
                        // Prints the caught exception in the Output Window
                        Print(Time[0] + " " + d.ToString());
                                }
                            }​​
        ​
        I altered the code from Close[0] to GetCurrentBid() / GetCurrentAsk () as you may run into issues with error messages if you put the wrong kind of order in - this will happen say at the Open when volatility can get very high and the market jumps or falls as you are entering your order; equally when the spread is very large, etc, etc
        ps I have not tested this in real market conditions so beware.

        Comment


          #34
          Hi Mindset

          Thank you for sharing your code to accomplish my request of automatically entering a Limit Buy if price is above the mouse cursor and a Limit Sell if price is below.

          Assuming the indicator is turned on, as evident from the clickable red/green button at the top right of the chart, this greatly reduces the cognitive load on the brain. Reducing the need for the brain to think whether to press the Alt or Shift key frees up brain neurons to focus on things that matter to a trade.

          If a physical keyboard button press is needed, it would be great to assign it to a single button but pair it with the criteria I mentioned.

          I tried the code you shared, but unfortunately was met with the following errors in the screenshot. Thank you again for your willingness to help.

          Click image for larger version

Name:	image.png
Views:	307
Size:	89.2 KB
ID:	1266573

          Comment


            #35
            Let me check my code. I didn’t have any errors but its possible I left an error in.
            Last edited by Mindset; 08-30-2023, 10:49 PM.

            Comment


              #36
              OldPorkChops
              Having some weird issues doing this - it compiles but with red underlined errors!!
              Oh and it works but I daren't send it to you until I have worked out what's going wrong.
              Edit - resolved
              ok a few things to be aware of
              1. this replaces the original so DELETE the original before you download - don't rename it. The Enums are public so you can only have one copy on your computer.
              2 The original is always available in the ecosystem and I have left the orignal buy button commented out so you can always go
              back to it if you want.
              3.This ONLY uses the buy button to perform a buy above the ASK and a Sell below the Bid.

              Happy Trading

              Attached Files
              Last edited by Mindset; 08-30-2023, 11:55 PM.

              Comment


                #37
                Hi Mindset,

                Thank you for taking time to share a stable version. Unfortunately, I encountered the following error when using it for the first time. Oh and thank you for moving the button to the Chart Trader panel. It saves valuable chart space that does not interfere with the "advance to current time" arrow.

                Click image for larger version

Name:	image.png
Views:	299
Size:	18.1 KB
ID:	1266886

                Comment


                  #38
                  I can't reproduce that error as it works fine on my copy. Try changing the Calculate to onEachTick - maybe you clicked when there had not been a price change and you would then get that error.
                  Alternatively just wait for the price to change once before you press any order buttons.
                  Any other issue just pm me

                  Comment


                    #39
                    I can see dominikbritz's preference for the two different keys for buy and sell. This allows you to place both buy and sell orders both above and below the market (i.e. if you want to go long and do a buy above the market, it enters a buy stop, if you click below the market it enters a buy limit.) This offers the versatility that one would expect.

                    But I can also see oldporkchops interest in simply sticking to limit orders, and having the indicator simply enter a buy or sell based on whether you click above or below the market. The cognitive load thing is real, and if you know you're only ever going to place limit orders, that could be useful.

                    Kudos to Mindset for making that adjustment. However, it appears the alteration accomplishes the opposite of what oldporkchops was asking for. When using Mindset's altered code, if I click above the market it enters a buy STP, and below the market, a sell SLM.

                    So I went ahead and made the necessary changes to accomplish what oldporkchops originally mentioned.
                    This will place buy limits below the market and sell limits above the market using the same key. (Just set the "Buy hotkey" as the single key you want to use. Sell is null.)

                    Thanks so much to dominikbritz and Mindset for their work on this. Such a great addon.
                    Attached Files

                    Comment


                      #40
                      Thank you, tradgrad for performing the necessary changes to make Mindset's version work. I appreciate both your help and more importantly, time. This community has been awesome at helping each other out.

                      I am especially grateful for tradgrad for recognizing the cognitive load issue and for understanding the need to focus on the evolving changes on our charts, and not need to think about what button we need to press in the heat of the moment.

                      tradgrad, my ideas for ideal one click trading directly on the chart without any accompanying keyboard buttons mostly comes from the indicator profiled in this video. There are other "chart trader indicators" but they are either too simple, or too advanced and hence, too complex, or requires a keyboard button press.

                      Alas, the chart trader indicator by Joel is out of my budget. The indicator that dominikbritz created meets most of my needs. The URL begins the video at the moment Joel introduces one-click trading (on his live account). His indicator is the best implementation of the one-click indicators that I know of in my opinion, and based on the configuration at the highlighted portion of the video, is a true one click trading indicator.

                      Also noteworthy at the 15:50 mark in the video is his explanation of toggling between stop orders, stop limit orders, and MIT orders with a one click on the right chart trader panel. This avoids the need to bring up the full list of indicators and refresh the chart. For those of us with tick replay enabled, this can mean tick data and other valuable indicator data does not disappear with the indicator reload.

                      tradgrad, I'm hopeful that after watching the highlighted portions of the video, you'll see the true value of having one click limits, as well as 1 + 1 click toggling between stop orders, stop limits, and MIT orders when such a change is intended.

                      Last edited by oldporkchops; 09-05-2023, 05:09 PM.

                      Comment


                        #41
                        LOL I apologise I completely misunderstood what oldPorkChops wanted - glad you could find a solution. Too much screen time I fear!

                        Comment


                          #42
                          In the video that oldporkchops linked, it shows the indicator actually displaying lines at the price levels where each bracket order would go, before the order is placed. He's able to hover the mouse over the chart and see a flag representing where the order would go, and a TP and STP, according to the selected ATM, effectively showing the distance to target/stop loss.

                          I am highly interested in this.

                          dominikbritz Mindset or anyone else... Do you have any idea how he was able to accomplish this?

                          Someone explicitly asked about it in another thread specifically for this purpose and NT support basically said it wasn't possible.

                          Click image for larger version

Name:	Essential Chart Trader Tools - NinjaTrader.mp4_snapshot_05.54.030 cr.jpg
Views:	264
Size:	27.0 KB
ID:	1267854

                          Comment


                            #43
                            Originally posted by tradgrad View Post

                            Someone explicitly asked about it in another thread specifically for this purpose and NT support basically said it wasn't possible.

                            Click image for larger version

Name:	Essential Chart Trader Tools - NinjaTrader.mp4_snapshot_05.54.030 cr.jpg
Views:	264
Size:	27.0 KB
ID:	1267854
                            Hi tradgrad, I kinda guessed you would be interested in this indicator. Great to know you want to incorporate its features into the indicator you helped revise. The developer over at Affordable Indicators sure knows his stuff and if I had to guess, has the grit and determination to get around what Ninja coding staff said wasn't possible.

                            No offense to Ninja coding staff, but I've lost count to the number of times I've heard the phrase attributed to Ninja staff, that "such a feature/coding structure is not possible with NinjaScript", only for said feature to be available soon after, often by a third party developer.

                            In the same video, there are other "hover to reveal" functions, such as when he hovers over the right hand margin to reveal the volume profile if I recall correctly. Just today, I watched a video where the Quick Drawing toolbar was hidden on the left margin, only to be revealed when the mouse cursor hovered over a certain area of the chart.

                            I do not have experience with coding, but if I can help contribute to this project via feature suggestions/requests, please let me know.

                            Thanks again for your willingness to create a true one click chart trader indicator.

                            Comment


                              #44
                              Yes it's doable but it takes a bunch of work to be honest and getting everything to knit together and not fall over, etc would take weeks!!
                              I just watched the video - there is a lot of it that is beyond my skillset - perhaps someone else could chip in?
                              Last edited by Mindset; 09-07-2023, 09:11 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by judysamnt7, 03-13-2023, 09:11 AM
                              4 responses
                              57 views
                              0 likes
                              Last Post DynamicTest  
                              Started by ScottWalsh, Today, 06:52 PM
                              4 responses
                              36 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by olisav57, Today, 07:39 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post olisav57  
                              Started by trilliantrader, Today, 03:01 PM
                              2 responses
                              19 views
                              0 likes
                              Last Post helpwanted  
                              Started by cre8able, Today, 07:24 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post cre8able  
                              Working...
                              X