fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. jstap
    3. Posts
    • Profile
    • Following 2
    • Followers 222
    • Topics 37
    • Posts 9382
    • Best 1086
    • Controversial 23
    • Groups 0

    Posts made by jstap

    • RE: How to Show Moving Average Indicator on Chart on MT5

      Because you would need to apply a template on a live chart

      posted in Questions & Answers
      jstap
      jstap
    • RE: Delete indicator with a button in Backtest

      Apply template doesn't work on backtest, would work on a live chart though

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to Show Moving Average Indicator on Chart on MT5

      You could use the draw block, but this isn't the same.

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to Show Moving Average Indicator on Chart on MT5

      Don't know if you can, possibly on init apply template, should work on live/demo but I have never tried

      posted in Questions & Answers
      jstap
      jstap
    • RE: Stand alone stop loss EA

      Purple position created (set to all trades), Pink blocks for each trade (set to all trades) pink modify stopes, (all on, on trade tab)

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to Show Moving Average Indicator on Chart on MT5

      I have a template with the exact name as my EA, when I test the template loads, for live/demo right click and add the template

      posted in Questions & Answers
      jstap
      jstap
    • RE: Stand alone stop loss EA

      Explain more of what you mean?

      posted in Questions & Answers
      jstap
      jstap
    • RE: how to define price level

      Then you need to start with that, once you have the IDs you can work with that, there is no simple method or indicator that can do this

      posted in Questions & Answers
      jstap
      jstap
    • RE: how to define price level

      Have you got the candle IDs of A & B?

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to implement TDI indicator on fxDreema

      Ask any question and I'll help you with what it does, there is too much to try and explain it all. In most blocks, you can select RSI indicator, the value from this is the current line value

      posted in Questions & Answers
      jstap
      jstap
    • RE: Creating a button

      If you search the forum you will find lots of info on this. Generally draw button off oninit, read button ontick, if on activate a close block, and redraw the button off

      posted in Questions & Answers
      jstap
      jstap
    • RE: check distance between positions then close one of them

      You can save the price when trade is placed in a variable, or get the value in pink blocks separately, save if needed, test and add a new shared link to see what is happening if not working

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to implement TDI indicator on fxDreema

      You'll have to check this, thank chat gbp if works:

      MT4 TDI.mq4

      MT4 TDI.ex4

      //+------------------------------------------------------------------+
      //| CustomIndicator.mq4 |
      //| Copyright 2024, MetaQuotes Software Corp. |
      //| https://www.mql5.com |
      //+------------------------------------------------------------------+
      #property indicator_separate_window
      #property indicator_buffers 6
      #property indicator_color1 Black
      #property indicator_color2 Red
      #property indicator_color3 Aqua
      #property indicator_color4 Aqua
      #property indicator_color5 Yellow
      #property indicator_color6 Blue

      // Indicator buffers
      double rsiBuffer[];
      double ma2Buffer[];
      double ma7Buffer[];
      double bbUpperBuffer[];
      double bbLowerBuffer[];
      double ma34Buffer[];

      // Input parameters
      input int rsiPeriod = 13; // RSI period: 13 or 21
      input int maPeriod1 = 2; // MA period 1: 2
      input int maPeriod2 = 7; // MA period 2: 7
      input int bbPeriod = 34; // Bollinger Bands period: 34
      input double bbDeviation = 1.618; // Bollinger Bands deviation: 1.618
      input int maPeriod3 = 34; // MA period 3: 34

      //+------------------------------------------------------------------+
      //| Custom indicator initialization function |
      //+------------------------------------------------------------------+
      int OnInit()
      {
      // Indicator buffers mapping
      SetIndexBuffer(0, ma2Buffer);
      SetIndexBuffer(1, ma7Buffer);
      SetIndexBuffer(2, bbUpperBuffer);
      SetIndexBuffer(3, bbLowerBuffer);
      SetIndexBuffer(4, ma34Buffer);
      SetIndexBuffer(5, rsiBuffer);

      // Indicator lines
      SetIndexStyle(0, DRAW_LINE);
      SetIndexLabel(0, "MA(2)");

      SetIndexStyle(1, DRAW_LINE);
      SetIndexLabel(1, "MA(7)");

      SetIndexStyle(2, DRAW_LINE);
      SetIndexLabel(2, "BB Upper");

      SetIndexStyle(3, DRAW_LINE);
      SetIndexLabel(3, "BB Lower");

      SetIndexStyle(4, DRAW_LINE);
      SetIndexLabel(4, "MA(34)");

      SetIndexStyle(5, DRAW_LINE);
      SetIndexLabel(5, "RSI");

      // Levels for RSI
      IndicatorSetInteger(INDICATOR_LEVELS, 3);
      IndicatorSetDouble(INDICATOR_LEVELVALUE, 0, 32.0);
      IndicatorSetDouble(INDICATOR_LEVELVALUE, 1, 50.0);
      IndicatorSetDouble(INDICATOR_LEVELVALUE, 2, 68.0);

      IndicatorShortName("Custom Indicator");

      return(INIT_SUCCEEDED);
      }

      //+------------------------------------------------------------------+
      //| Custom indicator iteration function |
      //+------------------------------------------------------------------+
      int OnCalculate(const int rates_total, // size of the price[] array
      const int prev_calculated, // bars handled on a previous call
      const datetime &time[], // Time
      const double &open[], // Open
      const double &high[], // High
      const double &low[], // Low
      const double &close[], // Close
      const long &tick_volume[], // Tick Volume
      const long &volume[], // Real Volume
      const int &spread[]) // Spread
      {
      int limit = rates_total - prev_calculated;
      if (limit > rates_total - bbPeriod - 1)
      limit = rates_total - bbPeriod - 1;

      // Calculate RSI
      for (int i = 0; i < limit; i++)
      {
      rsiBuffer[i] = iRSI(NULL, 0, rsiPeriod, PRICE_CLOSE, i);
      }

      // Calculate MA(2) on RSI
      for (int j = 0; j < limit; j++)
      {
      ma2Buffer[j] = iMAOnArray(rsiBuffer, rates_total, maPeriod1, 0, MODE_SMA, j);
      }

      // Calculate MA(7) on MA(2)
      for (int k = 0; k < limit; k++)
      {
      ma7Buffer[k] = iMAOnArray(ma2Buffer, rates_total, maPeriod2, 0, MODE_SMA, k);
      }

      // Calculate Bollinger Bands on RSI
      for (int m = 0; m < limit; m++)
      {
      double bbMid = iMAOnArray(rsiBuffer, rates_total, bbPeriod, 0, MODE_SMA, m);
      double bbStdDev = StdDev(rsiBuffer, bbPeriod, m);
      bbUpperBuffer[m] = bbMid + bbDeviation * bbStdDev;
      bbLowerBuffer[m] = bbMid - bbDeviation * bbStdDev;
      }

      // Calculate MA(34) on RSI
      for (int n = 0; n < limit; n++)
      {
      ma34Buffer[n] = iMAOnArray(rsiBuffer, rates_total, maPeriod3, 0, MODE_SMA, n);
      }

      return(rates_total);
      }

      //+------------------------------------------------------------------+
      //| Custom function to calculate standard deviation |
      //+------------------------------------------------------------------+
      double StdDev(const double &array[], int period, int start_index)
      {
      double sum = 0, mean = 0, stddev = 0;
      for (int p = 0; p < period; p++) // Use a different variable than 'i'
      {
      sum += array[start_index + p];
      }
      mean = sum / period;
      for (int q = 0; q < period; q++) // Use a different variable than 'i'
      {
      stddev += MathPow(array[start_index + q] - mean, 2);
      }
      return(MathSqrt(stddev / period));
      }
      //+------------------------------------------------------------------+

      posted in Questions & Answers
      jstap
      jstap
    • RE: Opening buy and sell limit orders at the quarter of the body of the ID1 candle helps

      pass block - comment block showing the relevant value, write something in the label for it to work

      posted in Questions & Answers
      jstap
      jstap
    • RE: Opening buy and sell limit orders at the quarter of the body of the ID1 candle helps

      I think I should have used + not -, put these values into a comment to check if you are getting a relevant value, and then use a process of elimination to work out which block is causing the issue.

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to implement TDI indicator on fxDreema

      Google is how I would search for it, you can use the EX file but if the values aren't in the data window you can't use it.

      posted in Questions & Answers
      jstap
      jstap
    • RE: EA not taking trades unless recently synced

      What I will sometimes do is, value 0 adjusted to +MaxSpread pips

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to implement TDI indicator on fxDreema

      @Chandler As @biztet has said you will need to get these values and work with them from the standard indicator, or find a custom indicator with buffers. If no data is in the window, then FX cannot get the value

      posted in Questions & Answers
      jstap
      jstap
    • RE: buffer

      I think it's probably
      ENUM_APPLIED_PRICE
      PRICE_CLOSE
      Not 100% sure but I think I have seen that icon before with enum types

      posted in Questions & Answers
      jstap
      jstap
    • RE: Delete indicator with a button in Backtest

      You don't need the pass block, they just need to be connected. I do not know how you would delete MAs
      image.png

      posted in Questions & Answers
      jstap
      jstap
    • 1
    • 2
    • 142
    • 143
    • 144
    • 145
    • 146
    • 469
    • 470
    • 144 / 470