Forums Trading Systems Discussion Filtering by Volume

Viewing 25 posts - 26 through 50 (of 228 total)
  • Author
    Posts
  • #9540
    scissors
    Participant

      Hi all, always wanted to learn mt4 coding but do not know where to start. Have learnt c++ before in high school so know some basic structure of mt4, but still like to learn from the start.

      It would be appreciated if the good and average coders can start a thread with given practical tutorials and solution to crash course the fellow penguins, so that we have more basic trained coders to help code the ideas by the experts.

      Just some comments,  if effort is too great we can simply ignore this comment :)

      Scissors

      #9555
      gg53
      Participant

        Hi all, always wanted to learn mt4 coding but do not know where to start. Have learnt c++ before in high school so know some basic structure of mt4, but still like to learn from the start. It would be appreciated if the good and average coders can start a thread with given practical tutorials and solution to crash course the fellow penguins, so that we have more basic trained coders to help code the ideas by the experts. Just some comments, if effort is too great we can simply ignore this comment :) Scissors

        Best to start with links posted by Simplex and/or Pipatronic.

         

        G.

        #9561
        pipatronic
        Participant

          Hi all, always wanted to learn mt4 coding but do not know where to start. Have learnt c++ before in high school so know some basic structure of mt4, but still like to learn from the start. It would be appreciated if the good and average coders can start a thread with given practical tutorials and solution to crash course the fellow penguins, so that we have more basic trained coders to help code the ideas by the experts. Just some comments, if effort is too great we can simply ignore this comment :) Scissors

           

          here you go

          http://penguintraders.com/forums/topic/useful-links/

          pip

          skype : pipatronic

          #9564
          scissors
          Participant

            Omg thanks everyone for the help and hope more penguin can join the thread for learning :)

            #9567
            simplex
            Moderator

              join the thread for learning

              Better go here!

              Best, s.

              A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

              #9592
              Anti
              Participant

                Hi, haven’t read all previous posts in detail. But I think following wasn’t mentioned.

                I tried to apply volume for a quite long time. Unfortunately my conclusions are that we can’t use volume alone. Maybe in combination with price levels, volume can give a good guess. I think we could obtain better results if we normalize volume not only by the average volume but also by the prize change over a bar. This conclusions came from the simple observation that especially big bars generate a very high volume. My idea was that we have to divide the volume by the prize changes during a candle’s lifetime. For instance, for an up bar we start usually anywhere (open), reach a lower level (low), rise to the high and end up at the close price. Thus, for up bars a guess could be

                volume/(open – low + high – low + high – close) = volume/(open-2low+2high-close).

                If we assume a nearly constant tick rate over the lifetime of particular candle, we could obtain better estimates of market activity. (I haven’t found this yet. It’s not perfect as small candles are biased towards higher activity.)

                Maybe you can use it. If you have an edge how to use, please let me know.

                • This reply was modified 10 years, 5 months ago by Anti.
                • This reply was modified 10 years, 5 months ago by Anti.
                • This reply was modified 10 years, 5 months ago by Anti.
                Attachments:
                You must be logged in to view attached files.
                #9595
                Anti
                Participant

                  Addendum: The idea was to identify prize regions for that tick activity (tick rate per pip) is extremely high which could indicate an oversold/overbought area. Maybe we also have to look at multiple pairs.

                  • This reply was modified 10 years, 5 months ago by Anti.
                  #9599
                  simplex
                  Moderator

                    This is obviously correct:

                    Unfortunately my conclusions are that we can’t use volume alone.

                    I placed that market activity indicator you provide aside my prototype and standard MT4 volume – see pic. Looking at its algorithm, I don’t see the objective in this sort of weighing (I would tend to call it weighing instead of normalization).

                    Areas of high volume cannot be identified clearly, as I would expect. Maybe I have to think about it longer. And if this makes sense I would feel more comfortable with an algo relying on High and Close alone instead of Open and Close (see several gg53 posts).

                    If we assume a nearly constant tick rate over the lifetime of particular candle…

                    Thats a hard assumption!

                    … we could obtain better estimates of market activity

                    For higher timeframes, we could work with volume of M1, thus getting away from your previous assumption and looking at volume at a more detailed sample rate. And at bar zero, we might even code a tick counter independent of any fixed timeframe.

                    s.

                    Attachments:
                    You must be logged in to view attached files.

                    A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                    #9601
                    Anti
                    Participant

                      Anti wrote:

                      If we assume a nearly constant tick rate over the lifetime of particular candle…

                      Thats a hard assumption!

                      … we could obtain better estimates of market activity

                      For higher timeframes, we could work with volume of M1, thus getting away from your previous assumption and looking at volume at a more detailed sample rate. And at bar zero, we might even code a tick counter independent of any fixed timeframe. s.

                      Yes, it’s a hard assumption. But I believe it may hold if we look at small time frames like 1m or below. Thus, your idea of using m1 for higher time frames or tick counter is preferred.

                      What do you think on the idea of a market profile that don’t uses the times prize stayed on particular levels but uses tick volume instead. Maybe this could show in a more clear way where support and resistance was (in past) and may be is in future.

                      • This reply was modified 10 years, 5 months ago by Anti.
                      • This reply was modified 10 years, 5 months ago by Anti.
                      #9604
                      gg53
                      Participant

                        Anti wrote:

                        If we assume a nearly constant tick rate over the lifetime of particular candle…

                        Thats a hard assumption!

                        … we could obtain better estimates of market activity

                        For higher timeframes, we could work with volume of M1, thus getting away from your previous assumption and looking at volume at a more detailed sample rate. And at bar zero, we might even code a tick counter independent of any fixed timeframe. s.

                        Yes, it’s a hard assumption. But I believe it may hold if we look at small time frames like 1m or below. Thus, your idea of using m1 for higher time frames or tick counter is preferred. What do you think on the idea of a market profile that don’t uses the times prize stayed on particular levels but uses tick volume instead. Maybe this could show in a more clear way where support and resistance was (in past) and may be is in future.

                        Look at M1 TickVolume indicator and you’ll see that this assumption is totally wrong.

                         

                        G.

                        #9607
                        Anti
                        Participant

                          The assumption is not that the tick rate is equal over two or more bars. It’s that it’s constant for the lifetime of a bar. That can’t be seen in Tickvolume Indicators. But it can be seen on a tick chart. Surely, the assumption is not correct all time. but it’s an approximation.

                          #9615
                          simplex
                          Moderator

                            It’s that it’s constant for the lifetime of a bar.

                            Ok. Let’s assume we’re working on M15, and the total tickvolume of a certain bar has the value V. If your assumption (I don’t call it an approximation, for it’s a simple averaging) were correct, then every single M1 bar which are engulfed by the M15 bar in question has to have more or less equal volume of  V / 15 .

                            Can you really show me such an M15 bar? And if you can find one such bar, can you really find enough of that kind to use this as kind of a ‘rule’? And if you find it’s not true for M15, why should it be true for M1?

                            I believe if you started a detailed analysis on that topic you would falsify your assumption at a glance. And there is nothing wrong with false assumptions in research and development: that’s daily business.

                            But let’s look at a technical MT4 issue that leads to this discussion: the lack of tick data in MT history. We only have ticks on bar zero.

                            If we want to have price and volume history on every tick, we got to generate that specific history ourselves. We could easily log the data into a csv file or maybe directly into a database (didn’t @Saver0 start something like this?). Required analysis could be done outside MT and given back to MT via an interface that would have to be developed.

                            We can easily log the data over days and weeks, depends on what makes sense for the time horizon of our intended analysis.

                            So: Logging the data is easy. Analysing data outside MT is also easy. How to transfer results back to MT in real time?

                            On the other hand: maybe analysis outside MT is only interesting to run statistics in retrospect, an to find rules this way. If the time horizon of our real time analysis is not too long, it might be sufficient to log tick data in large arrays inside MT and then analyze those arrays.

                            What would be the exact objective of this kind of analysis? What could we achieve? Does it make sense?

                            Just thinking aloud and publicly at the moment – any feedback and further ideas appreciated!

                            s.

                            A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                            #9622
                            Anti
                            Participant

                              Maybe we can finde M15 bars that fulfill your requirements. But that’s not what my intention was. I think that we have to use the smallest TF in MT or even lower TFs (artificially calculated from tick data).

                              My idea originated from the idea that market is driven by support and resistance. Whenever a market maker wants to change the prize trend, he goes long/short until all buyers/sellers of previous direction have been exhausted. Additionally, when prize goes to another direction, many asset holders sell/buy to ensure money. Both should lead to an increased tick activity. Thus the idea was that an increase in the tick activity rate could indicate potential turning points. But to identify such increased tick rates, we have to look at the tick activity per prize change (e.g. tick changes/pip.

                              Most probably IT IS necessary to follow tick by tick. Unfortunately I’m not a good programmer and I wasn’t able to connect R (the only language for which I have advanced skills) to MT4. If someone believes in this idea, maybe we could work together to get more out of it. Maybe gg53 is doing something else with the oversold/overbought volume oscillator?!

                              #9629
                              Lowphat
                              Participant

                                if you do decide to log ticks might be some useful stuff in this

                                Attachments:
                                You must be logged in to view attached files.

                                “I believe the very best money is made at the market turns. Everyone says you get killed trying to pick tops and bottoms and you make all
                                your money by playing the trend in the middle. Well for twelve years I have been missing the meat in the middle but I have made a lot of
                                money at tops and bottoms.”
                                – Paul Tudor Jones

                                #9634
                                simplex
                                Moderator

                                  Yep:

                                  if you do decide to log ticks might be some useful stuff in this

                                  … might detain us from reinventing the wheel :good:

                                  Thanks, s.

                                  A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                  #9635
                                  simplex
                                  Moderator

                                    Interesting:

                                    connect R (the only language for which I have advanced skills) to MT4

                                    First of all let’s keep in mind that our personal skills seem to complement: could be interesting for future development. I never found (or invested) the spare time required to learn R.

                                    Is a real time interface necessary? See also my above post for that. Logging csv from MT and importing (offline) into R should be easy. So offline analysis could be achieved.

                                    The question is: what would be the exact objective of this kind of analysis?

                                    A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                    #9638
                                    Anti
                                    Participant

                                      A good question. I have to think about it to grasp clear questions.

                                      But before I’d like to hear your opinion on the idea that market only changes direction when higher tick rates occur.

                                      • This reply was modified 10 years, 5 months ago by Anti.
                                      #9641
                                      simplex
                                      Moderator

                                        But before I’d like to hear your opinion on the idea that market only changes direction when higher tick rates occur.

                                        I have no stats about that topic – might be interesting to generate some.

                                        (a) From purely visual perception I would say that an increased probability of a trend / swing change exists when volume rises above short term average.

                                        (b) On the other hand: boost of a current trend / swing can also be escorted by a sudden rise of volume.

                                        How to identify both cases? Correlation between (normalized) volume and absolute price change (MathAbs(DeltaPrice)), I would guess: Pearson or Spearman Correlation. Never checked that, but might worth trying.

                                        Case (a) should lead to a decreasing correlation, case (b) to an increasing or stagnant one.

                                        s.

                                        • This reply was modified 10 years, 5 months ago by simplex. Reason: clarification

                                        A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                        #9643
                                        Anti
                                        Participant

                                          Will do some statistics on that topic tomorrow and present it here.

                                          #9647
                                          simplex
                                          Moderator

                                            Great:

                                            Will do some statistics on that topic tomorrow and present it here.

                                            Just now that we’re chatting here a newsletter dropped in pointing me there: Better Tests with Oversampling

                                            Not exactly our topic, but interesting aspects to consider.

                                            s.

                                            A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                            #9666
                                            Anti
                                            Participant

                                              Ok, here are some first findings. What I did was a correlation analysis (Pearson) between

                                              (a) volume and the absolute value of the open – close difference,

                                              (b) volume and high – low difference, and

                                              (c) volume and prize path, calculated as open-2*low+2*high-close (for up bars), 2*high-open-2*low+close (for down bars), 2*(high-low) (for dojis with high unequal low), and 0 (for high=low).

                                              For the analysis I used 10,000 1 minute candle’s data from 2015.10.15 (07:55) until 2015.10.30 (21:49) from one of the brokers I use (think it was from FxPro but I’m not absolutely sure).

                                              Results:

                                              All correlations were significant (p < 2.2e-16). It means that the correlation coefficient differs significantly from 0 (straight line parallel to x axis). The correlations were as following:

                                              (a) r = 0.5314907

                                              (b) r = 0.7387866

                                              (c) r = 0.7699212

                                              Thus, for the sample, the prize path is best explained by volume or vice versa. As we see a fair linear relationship in (c), my conclusion would be that standardizing volume by prize path can give a good estimation of tick activity rate.

                                              Attached you can find scatter plots for data of all three correlations performed as well as my MT4 indicator which uses this standarization. At the moment it’s hard to draw conclusions from increased tick activity rate. But maybe a previous normalization by mean volume could give a better picture.

                                              That’s all for now as local time is 3:39 a.m. and I haven’t slept yet. GN8

                                              • This reply was modified 10 years, 5 months ago by Anti.
                                              • This reply was modified 10 years, 5 months ago by Anti.
                                              Attachments:
                                              You must be logged in to view attached files.
                                              #9674
                                              simplex
                                              Moderator

                                                @Anti: Wow – great committment – thanks for that!

                                                That’s all for now as local time is 3:39 a.m. and I haven’t slept yet.

                                                I know such nights: welcome to the club!

                                                Your results are interesting, and not surprising:

                                                • r(a) << r(b) and r(a) << r(c) indicates clearly that relying in close prices alone (like many traders do) is not a good idea
                                                • r(b) < r(c) provides a rather weak indication that close prices are not completely insignificant
                                                • price path as defined in your post might be a good choice when starting to exploit this in an indicator

                                                As to real time analysis: what I originally had in mind was a ranking correlation analysis based on significantly smaller sample sizes, lets say between 10 (or even less) and 30 samples (rolling sample window in the time domain). For that kind of analysis I would expect correlation coefficients to behave like described above.

                                                I’m aware of the fact that the reliability of such small samples will be significantly weaker as compared to those 10,000 samples you used. Yet when we’re trying to exploit effects that have a medium lifetime of only a few bars we don’t have another choice, right?

                                                What’s your opinion about this approach?

                                                I do have ranking correlation algos at hand in mq4, but likely won’t have the spare time to adopt them to match our problem before next weekend.

                                                Talking about standardizing / weighing / normalizing volume: volume undergoes much larger swing amplitudes than prices. So maybe it could be useful to compare price swings to log(volume) or log(normalized_volume) instead of pure volume. Just an idea for the moment.

                                                s.

                                                A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                                #9678
                                                Anti
                                                Participant

                                                  Thank you, @simplex. I extended my analysis over 2,143,688 M1 bars. It took roughly 4 hours for calculations due to my lame PC. Nevertheless, again all correlations were highly significant and the correlation between volume and prize path showed again highest coefficients.

                                                  Thus, I’d summarize that prize path is proportional to volume itself. From this point we can see that tick activity rate is approximately constant over prize movement. Therefore, my initially assumption is supported by these findings. My further opinion is that we have to normalize volume by prize movement as high volumes alone can be also only explained by a relatively big rise in prize.

                                                  From this fact now we also can estimate up and down volume from pure prize action without counting every tick and its direction as long as we use small TFs. For our purpose I don’t see problems in using close prizes as for volume of the MT4 standard indicator we have a clear relationship between open, close and volume: volume is defined for the lapse of opening and closing time of a particular candle.

                                                  Other findings you can be concluded from my scatterplot in post #9666. It is that volume is usually low and rarely high (please see attached histogram for n = 2,143,688 candles). In most cases for the 1M candles of EURUSD it is between 0 and 120 (for my broker). But whenever volume becomes big (> 250) the prize path tend to underestimate real value as indicated by increasing variance.

                                                  I’m not quite sure if I fully understand your idea. My interpretation is that we should have a look on the predictive power of volume on subsequent x bars?! I give it a try as soon as I have time for.

                                                  • This reply was modified 10 years, 4 months ago by Anti.
                                                  • This reply was modified 10 years, 4 months ago by Anti.
                                                  • This reply was modified 10 years, 4 months ago by Anti.
                                                  Attachments:
                                                  You must be logged in to view attached files.
                                                  #9686
                                                  gg53
                                                  Participant

                                                    Thank you, @simplex. I extended my analysis over 2,143,688 M1 bars. It took roughly 4 hours for calculations due to my lame PC. Nevertheless, again all correlations were highly significant and the correlation between volume and prize path showed again highest coefficients. Thus, I’d summarize that prize path is proportional to volume itself. From this point we can see that tick activity rate is approximately constant over prize movement. Therefore, my initially assumption is supported by these findings. My further opinion is that we have to normalize volume by prize movement as high volumes alone can be also only explained by a relatively big rise in prize. From this fact now we also can estimate up and down volume from pure prize action without counting every tick and its direction as long as we use small TFs. For our purpose I don’t see problems in using close prizes as for volume of the MT4 standard indicator we have a clear relationship between open, close and volume: volume is defined for the lapse of opening and closing time of a particular candle. Other findings you can be concluded from my scatterplot in post #9666. It is that volume is usually low and rarely high (please see attached histogram for n = 2,143,688 candles). In most cases for the 1M candles of EURUSD it is between 0 and 120 (for my broker). But whenever volume becomes big (> 250) the prize path tend to underestimate real value as indicated by increasing variance. I’m not quite sure if I fully understand your idea. My interpretation is that we should have a look on the predictive power of volume on subsequent x bars?! I give it a try as soon as I have time for.

                                                    Your assumptions regarding Volume and price movement are wrong.

                                                    Almost all Doji (or near Doji) bars  have high Volume…with almost “0” price movement.

                                                    Volume is a LEADING indicator, and as such it will indicate near future move or reversal.

                                                    If you are familiar with correlation and its math – using tick data you can analyze which one is the “Leader” and which one is the “Follower”, not just the fact that they are “correlated”.

                                                     

                                                    G.

                                                    #9687
                                                    gg53
                                                    Participant

                                                      If you look at my ForexGT_VolumeOsc (the Volume Oscillator) you’ll see that 80% of the market (between the +40 and -40 lines) lies most of the market.

                                                      When the Oscillator is above that – it’s almost shure (and accurate) market swing point, usually with minimal price movement.

                                                      …and if you watch tick-rate on tick chart you’ll also notice variation within same TF. For that you’ll need fast PC with fast internet connection.

                                                      Even TickVolume indicator, with its textual real-time Buyers/Sellers on the right side of the indicator shows it.

                                                       

                                                      G.

                                                    Viewing 25 posts - 26 through 50 (of 228 total)
                                                    • You must be logged in to reply to this topic.
                                                    Scroll to Top