Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Show CurrentBid -4 Ticks on Chart

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

    Show CurrentBid -4 Ticks on Chart

    Good morning,

    I build a simple strategy yesterday that shows a text (Buy/Sell) on the Chart once the MACD Cross above/below the average line.
    I was wondering if it is possible to combine text with the the current Bid -4 ticks (e.g. BUY at 1045 ) and display this on the chart while the signal occurs.

    Many Thanks in advance for reading so far :-)

    #2
    Strategy doesn't run

    Hello,

    I wanted to check if the Strategy is showing the BUY/SELL Text on the the Sim101 account this morning but when the MACD cross occur no Signal is showing? When I open the Strategy window and press ok I see the Signal on the chart. It seems like the Strategy is not executing in realtime.

    Please can you advice if I have to change some options in order to have the Strategy show signals when they occur.

    Many Thanks!

    Comment


      #3
      Kroete, you could for sure include the current bid via GetCurrentBid in your signal drawing - http://www.ninjatrader-support.com/H...urrentBid.html

      On your second question I'm not sure I follow - are you expecting to autotrade these crossovers via your BUY / SELL plots? This would not work, as it's must visual, for execution you would need to enter the appropriate Enter() methods following your crossover conditions, for an example you can review the 'SampleMACrossOver' we ship per default.
      BertrandNinjaTrader Customer Service

      Comment


        #4
        CurrentBid and Text on Autotrade

        Thank you for you quick response Bertrand,
        The Strategy I have build is not meant to execute buy or sell orders, but give a text and alarm on the chart while the signal (MACD Crossover) occurs.
        If the DrawText() method isn't working on Auto trade is there another way this Signal can be implemented? The idea behind is to avoid sitting in front of the screen the whole time and wait for a signal but instead stay in another room and wait for a sound and a Signal on the screen when the cross happen.

        I have attached the code fragment, please can you advice if this is working like that and also give a hint how I can implement the CurrentBid() method ino the DrawText() method in order to see the price.

        Many Thanks!
        Attached Files

        Comment


          #5
          Thanks for clarifying, for sure you could use a strategy to just drawn and issue sound alerts - any errors in the log tab as you don't see those triggering as you would expect? Have you tried also with the standard MACD indicator?

          To show the current bid just add this to your text string you display, for example "MyBuySignal is @" + " " + GetCurrentBid().ToString()
          Last edited by NinjaTrader_Bertrand; 03-30-2010, 06:30 AM. Reason: spelling
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Thank you very much Bertrand! The log tap didn't show any error's, I will try it with the standard MACD again. After the Strategy is running I will try to adjust the code with the CurrentBid.String.

            You are a great help!

            Comment


              #7
              You're welcome - I vaguely remember ZLMACD issues (as there were versions with hardcoded CalculateOnBarClose settings floating around), thus please try with the standard MACD method we provide to compare.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                GetCurrentBid().To String()

                I have changed the Strategy to the default MACD and it is working now :-)
                Please can you give me more information or examples how to implement the To String() in my Strategy as I am unable to get it right from the example you posted earlier.

                I have no clue about coding but I hope to change this with time.

                Many Thanks!

                Comment


                  #9
                  Great the standard MACD workds for you - sure, which exact calls are you using now in your strategy to draw the signals?
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    CurrentBid().To String() and Alert help

                    Please find below the calls for the Strategy
                    I also noticed that the alert keep sounding once the signal occur, can you help me to change the code that the alarm goes just one time?


                    // Condition set 1
                    if (CrossAbove(MACD(12, 26, 9), MACD(12, 26, 9).Avg, 1))
                    {
                    DrawText("BUY" + CurrentBar, "PossibleBUY", 1, Low[0] + 2 * TickSize, Color.Green);
                    PlaySound(@"C:\NinjaTrader 6.5\sounds\Alert4.wav");


                    Thank you very much!

                    Comment


                      #11
                      You could try something like this Kroete -

                      Code:
                       
                      // Condition set 1
                      if (CrossAbove(MACD(12, 26, 9), MACD(12, 26, 9).Avg, 1))
                      {
                      DrawText("BUY" + CurrentBar, "PossibleBUY" + " " + GetCurrentBid().ToString()
                      , 1, Low[0] + 2 * TickSize, Color.Green);
                      PlaySound(@"C:\NinjaTrader 6.5\sounds\Alert4.wav");
                      If you're looking for an alert that would stay idle for a user set amount of seconds, please look into working with the Alert() method instead of PlaySounds.
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        Perfect!!! Thanks again for you help.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Segwin, 05-07-2018, 02:15 PM
                        14 responses
                        1,788 views
                        0 likes
                        Last Post aligator  
                        Started by Jimmyk, 01-26-2018, 05:19 AM
                        6 responses
                        837 views
                        0 likes
                        Last Post emuns
                        by emuns
                         
                        Started by jxs_xrj, 01-12-2020, 09:49 AM
                        6 responses
                        3,293 views
                        1 like
                        Last Post jgualdronc  
                        Started by Touch-Ups, Today, 10:36 AM
                        0 responses
                        13 views
                        0 likes
                        Last Post Touch-Ups  
                        Started by geddyisodin, 04-25-2024, 05:20 AM
                        11 responses
                        63 views
                        0 likes
                        Last Post halgo_boulder  
                        Working...
                        X