fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. rafaelgrecco
    3. Best
    R
    • Profile
    • Following 0
    • Followers 1
    • Topics 28
    • Posts 111
    • Best 7
    • Controversial 0
    • Groups 0

    Best posts made by rafaelgrecco

    • RE: Calculating Simple Moving Average of a Indicator

      Ok, I figured it out.

      Each "Modify Variables" can modify up to 5 variables at once, so 3 blocks can handle 14 periods for example.

      The "Formula" block only has simple operations, but we can add more operations on "Adjust the result" field. So we can sum all variables (as many as we want) using a single block.

      It is a lot of stuff to keep track, but it works using only a few blocks. I should have tested a little more before posting.

      Anyway, I hope this information can help someone if they are looking to do something similar.

      posted in Questions & Answers
      R
      rafaelgrecco
    • RE: object on chart has no parameter

      Hi,

      I confirm this bug. I am also waiting for a fix!

      Best Regards.

      posted in Bug Reports
      R
      rafaelgrecco
    • Calculating Simple Moving Average of a Indicator

      Hi! I am trying to calculate the SMA (simple moving average) of a Indicator.

      Simple Moving Average is the sum of the closing prices divided by the period number.

      Example SMA for 5 periods: (1.0399 + 1.0394 + 1.0387+ 1.09375 + 1.09382) / 5 = 1.0387

      This is calculated automaticaly by the indicator.

      I want to have a Simple Moving Avarage for a Indicator, for example Momentum. The calculus would be same same, but using Momentum data instead of price, so I can compare them.

      Example SMA for 5 periods of Momentum Indicator: (100.2094 + 99.9420 + 99.0634 + 99.2944 + 99.4350) / 5 = 99.8884 - This would be the SMA that I wanted.

      This way I can compare the SMA of the Indicator with the Indicator data itself.

      What I currently have is:

      Have 5 Variables (M1 to M5), each with a Candle ID (0, 1, 2, 3, 4) of the Momentum Indicator. Then use Formulas blocks to sum all variables and put on secondary variables so I can sum all of them:

      M1 + M2 = T1
      M3 + T1 = T2
      M4 + T2 = T3
      M5 + T3 = T4 (here I have all candles summed up)

      Now divide T4 by 5 = SMA. This is the Simple Moving Average of the Indicator.

      Now imagine I want a SMA of 9, 14 or 21 periods... it would be too much to do this way. Is there a better and simpler way to achieve this?

      Thanks.

      posted in Questions & Answers
      R
      rafaelgrecco
    • RE: How to close all open orders at 5:00 PM, for example?

      @cjdduarte

      Using a Hours filter block, like this:

      https://fxdreema.com/shared/p69qvTG2

      If you mean all orders, including manually open, change the filter on the Close trades blocks to all orders (by default, it will only close orders opened by itself).

      posted in Questions & Answers
      R
      rafaelgrecco
    • RE: How to Select "Least profitable trade"?

      Hi @roar

      Thank you very much for your help! Using your example I was able to make something that works on my strategy!

      What I was missing was:

      • Reseting the variable "smallestprofit" on every new loop
      • Using the second output of "Each Trade" to wait for all trades to be checked

      Best regards!

      posted in Questions & Answers
      R
      rafaelgrecco
    • RE: Once per bar and No position together?

      The block is called "No trade" on MQL4 projects and "No Position" on MQL5 projects, but they are the same thing.

      Make sure you are using the correct block (there is one block for position, one for pending order and one for both).

      It should work like you said: Once Per Bar -> No Position. At least it works on MQL4 projects.

      posted in Questions & Answers
      R
      rafaelgrecco
    • RE: Working with Terminal Variables (Global Variables on MT4)

      Thank you very much!

      I didn't know there was a tutorial for it...

      posted in Questions & Answers
      R
      rafaelgrecco
    • 1 / 1