Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Scalper

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

    #31
    Hello Gumphrie,

    Could you or someone else with more ninjascript expireance than me please tell me (help me) what I should add to your code so that a arrow is ploted under or above the bar which activates the scalper bar (if this is not a complicated modification), I mean, when a scalper UP bar is ploted that a UP arrow plots under the bar (bar 0) which just closed above the trigger bar and makes the scalper bar plot and the same for DOWN (sorry, not shure if I expres myselfe clear).
    Last edited by whitegun; 11-10-2007, 05:09 AM.

    Comment


      #32
      Hi Whitegun,

      Isn't that the "Highlight current trigger bars" true/false config option in the properties? Do you have the latest version?

      Comment


        #33
        Hi Gumphrie,

        Yes, I have the latest version but it is not the "Highlight current trigger bars" true/false config option what I am talkinig about.

        At the moment there is absolutly no way to use scalper for a ATM strategy (this is how I see it, if I am wrong please correct me).

        As scalper didn't is a plain bar or line plot but it is overriding the Plot class seams that it is not recognized at all in a ATM strategy, means, if I create a verry simple ATM strategy for test (using the strategy wizard) like: scalper(low)[3]>SMA(14)[3] go long (if 3 bars ago there is a scalper signal and the low of the scalper bar is higher than a 14day SMA 3 bars ago go long), the scalper is totaly ignored in the strategy, it simply enters long on the first bar (3 bars ago) above SMA.

        However, the "Highlight current trigger bars" option can not be used in a ATM strategy because there would be a lot of wrong entries. When the arrow apear that not always means that you will get a scalper bar, if there is no close above or bellow the triger you simply get a new triger in an other place but you only wont enter if you get a confirmed scalper bar not only a posible one.


        Please have a look at the atached picture:

        What I mean is, bars that just made the scalper bar paint (bar 0 that closed above or below the trigger bar) get at the same time that the scalper bar is painted a arrow plotted above or below them.
        In a ATM strategy the entry would be at the next bar after the bar with the arrow.
        I suppose if now you would say: scalper(low)[0]>SMA(14)[0] enter long it should work (or am I wrong??)

        Best Regards
        Attached Files

        Comment


          #34
          Hi Whitegun,

          Yes, there are two thing things that make it hard to use in any strategy.

          1. It overrides the Plot class and doesn't actually write out any plots a strategy could pick up. You could get around this by creating another indicator using the same code that does write out a plot, but...
          2. It colours in the bars retrospectively so anything you plot will not match up with the actual bars plotted.


          That said, please find attached an indicator that has two plots, "ScalpUpSeries" and "ScalpDownSeries" in different colours. If you add it to your chart it will plot a positive value ("1") when a Scalp Up bar is detected and a negative value ("-1") when a Scalp Down Bar is plotted. So something like :

          Code:
          [FONT=Courier New] if (ScalpPlot.ScalpUpSeries[0]==1)
          [/FONT] [FONT=Courier New][SIZE=2]{[/SIZE][/FONT][FONT=Courier New]
             [/FONT][FONT=Courier New][SIZE=2]EnterShort(DefaultQuantity, [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]""[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);[/SIZE]
          [/FONT] [FONT=Courier New][SIZE=2]}[/SIZE][/FONT]

          Attached Files

          Comment


            #35
            Very nice. This could be very useful if used in conjunction with other filters to eliminate the many uninteresting triggers which happen in the market goes sideways for a while.

            I'm curious about the color scheme, and naming conventions, however. It would seem more intuitive to me if red & green were reversed, so a green indication preceded an uptrend, and if ScalpUpSeries were used to indicate time to EnterLong, etc.

            Am I missing something here?

            Comment


              #36
              Hi KBJ

              ScalpUpSeries represents a high bar being painted, so that's why you would go short, and vica versa. I see there could be confusion between 'going up' and 'had an up', in which case I was thinking of the latter. They're just names I picked up at random when I was hacking the original code, so feel free to change it or suggest new ones.

              Comment


                #37
                What's most important is that the indicator is available for use. Thanks for creating it.

                Comment


                  #38
                  Thank you verry much Gumphrie!

                  Its exactly what I need and was searching, it works great.

                  Thanks!!!

                  Regards

                  Comment


                    #39
                    Modify to keep arrows ?

                    Hello Gumphrie,

                    I wonder if this indicator can be modified to KEEP the painted arrows on the chart?

                    It's a great indicator - Thank you very much!
                    Jack

                    Comment


                      #40
                      Originally posted by jackj90 View Post
                      I wonder if this indicator can be modified to KEEP the painted arrows on the chart?
                      Hi Jack, do you mean all of them or just the final ones? As the current trigger bar can change depending if it actually results in a scalp bar. You can easily populate a DataSeries to put all of them in, tricky bit will be taking out the redundant ones.

                      Comment


                        #41
                        Hi Gumphrie
                        I meant all the PERMANENT ones.

                        I'm not a coder, so I have no idea what 'DataSeries' is..........

                        Even without keeping them all, its a wonderful indicator.

                        Thank you.

                        Jack

                        Comment


                          #42
                          Hi Gumphrie and all,
                          Would anyone know how to add an audio alert with the painting of the up/down arrow?

                          Thanks,
                          Jack

                          Comment


                            #43
                            It would just be a matter of adding this function to the code when it paints up/down.

                            PlaySound()
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #44
                              Hi Josh,

                              Well, I added
                              PlaySound(@"C:\Program Files\NinjaTrader 6\sounds\Alert1.wav");
                              into the script, but I don't really know the script, or, where it would go.

                              Thanks anyway.
                              Jack

                              Comment


                                #45
                                Unfortunately I have not reviewed Gumphrie's code, but you would generally put it in the same code block that the indicator marks the bars with.
                                Josh P.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by cre8able, Today, 03:20 PM
                                1 response
                                9 views
                                0 likes
                                Last Post cre8able  
                                Started by fiddich, Today, 05:25 PM
                                0 responses
                                3 views
                                0 likes
                                Last Post fiddich
                                by fiddich
                                 
                                Started by gemify, 11-11-2022, 11:52 AM
                                6 responses
                                804 views
                                2 likes
                                Last Post ultls
                                by ultls
                                 
                                Started by ScottWalsh, Today, 04:52 PM
                                0 responses
                                4 views
                                0 likes
                                Last Post ScottWalsh  
                                Started by ScottWalsh, Today, 04:29 PM
                                0 responses
                                9 views
                                0 likes
                                Last Post ScottWalsh  
                                Working...
                                X