fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. VanceDavid
    3. Posts
    V
    • Profile
    • Following 0
    • Followers 0
    • Topics 16
    • Posts 34
    • Best 5
    • Controversial 1
    • Groups 0

    Posts made by VanceDavid

    • when creating code for custom blocks MQL functions do not work. ALSo Loops do not work.

      Function examples:
      Example Purpose: Returns the larger of two values.

      Syntax: MathMax(value1, value2)

      double a = 5.0;
      double b = 10.0;
      double max_value = MathMax(a, b); // max_value will be 10.0

      MathMin
      Purpose: Returns the smaller of two values.

      Syntax: MathMin(value1, value2)

      Example:

      mql
      double a = 5.0;
      double b = 10.0;
      double min_value = MathMin(a, b); // min_value will be 5.0

      No Functions work Why. ALSO loops don't work why.

      Here's an example in MQL5 to calculate the largest body bar between bar 1 and bar 5. In this context, the "body" of a bar is the absolute difference between the opening and closing prices of that bar.

      Example Code:

      void OnStart()
      {
      // Arrays to hold the open and close prices of bars
      double openPrices[5], closePrices[5];

      // Assign example prices for bars 1 to 5
      openPrices[0] = 1.1234; closePrices[0] = 1.1244; // Bar 1
      openPrices[1] = 1.1245; closePrices[1] = 1.1210; // Bar 2
      openPrices[2] = 1.1205; closePrices[2] = 1.1230; // Bar 3
      openPrices[3] = 1.1225; closePrices[3] = 1.1215; // Bar 4
      openPrices[4] = 1.1250; closePrices[4] = 1.1280; // Bar 5
      
      // Variable to hold the largest body size
      double largestBodySize = 0;
      int largestBodyIndex = -1;
      
      // Calculate the body size for each bar and find the largest
      for (int i = 0; i < 5; i++)
      {
          double bodySize = MathAbs(closePrices[i] - openPrices[i]);
          if (bodySize > largestBodySize)
          {
              largestBodySize = bodySize;
              largestBodyIndex = i;
          }
      }
      
      // Print the result
      Print("The largest body is at bar ", largestBodyIndex + 1, " with a size of ", largestBodySize);
      

      }

      WHy! or how to get functions and loops to work?

      posted in Questions & Answers
      V
      VanceDavid
    • All MQL5 Projects disappeared. When I go to load my last MQL5 Project it comes up as MQl4 Project and the project blacks do not show.

      All MQL5 Projects disappeared. When I go to load my last MQL5 Project it comes up as MQl4 Project and the project blacks do not show.Screenshot 2024-12-16 161038.png

      posted in Bug Reports
      V
      VanceDavid
    • RE: Cannot display comment for Zero (0) properly

      Thank you jstrap. You resolved my problem. I had thought that I tried the no decimal toggle but I must have been wrong. Thank you.

      posted in Questions & Answers
      V
      VanceDavid
    • RE: Cannot display comment for Zero (0) properly

      New Shared Project Address: https://fxdreema.com/shared/YIWKY15de

      posted in Questions & Answers
      V
      VanceDavid
    • Cannot display comment for Zero (0) properly

      Hi I have tried many different setting to display my test result which is an integer 0 when the test results in a negative result. Displaying the result in a comment does not show 0 Zero but shows 0.0000000000000e+00.

      How do I display properly?

      Shared project: shared/7sureSrke

      posted in Questions & Answers
      V
      VanceDavid
    • 4k Monitor - Comment blocks Values overlay on screen

      Purchased 2 new 4k monitors. Comment blocks overlap on screen. Changing font sizes does not fix problem. All Values overlap.

      With the new 4k monitors gaining market share your comment blocks need to address this issue otherwise comment blocks become useless. Very frustrating.

      We require greater control of spacing and field spacing between values, labels etc. The same thing with ugly comments blocks.

      posted in Bug Reports
      V
      VanceDavid
    • Want to Pay using Visa

      I want to pay for a subscription using Visa Card. I do not have a Paypal account. I See Step 1 - Select Time subscription pay period, OK Done. Step 2. - Select payment option. Paypal or stripe or various coins. I do not have any of these. I simply want to pay by Visa. How do I do this.?

      posted in Questions & Answers
      V
      VanceDavid
    • How to load Chart template

      Shared project : https://fxdreema.com/shared/MrcrbmySc

      0_1617989981308_Variables - test 03 L.png

      My Ea calculates the highest and lowest close in a range and stores the value into a variable HighestClose, LowestClose. The Ea seems to works.

      There are 2 Issues (problems)

      1. I want to load default chart template:

      When my ea back test loads it defaults to a black screen with green bars. I want to automatically change this default to a different chart template once the EA starts running. In MT4, I have a light.tpl saved and stored in the template folder with other templates.

      I have tried many things to get this light.tpl to load once the ea starts running. All have been unsuccessful. How is this accomplished?

      2. Draw Tex Block Issue:

      Is there any way to actually have the draw take place over or under the candle. It currently draws the Text Value in the middle of the bar most of the time.

      Thanks you for any help.
      VanceDavid

      posted in Questions & Answers
      V
      VanceDavid
    • RE: identify Highest close of last 10 candles then store to variable

      @roar

      Thank Your Roar. Problem Solved.

      I was thinking. How could I create a custom block so that I could select Highest High easily and simply change the number of bars to calculate on.

      Would this even be a worthwhile endeavor. It most certainly would be a good learning or teaching endeavor.

      Thanks again roar.

      VanceDavid

      posted in Questions & Answers
      V
      VanceDavid
    • RE: identify Highest close of last 10 candles then store to variable

      @jsauter86

      Thank You jsauter86.

      You are right about highest price in Market properties. Unfortunately I really wanted the highest close of the last 10 candles (x Candles).

      Market properties does not seem to allow for the highest Close only the highest price.

      Thank you for your helpful and good suggestion.

      VanceDavid

      posted in Questions & Answers
      V
      VanceDavid
    • RE: identify Highest close of last 10 candles then store to variable

      @roar
      You said in identify Highest close of last 10 candles then store to variable:

      there is a direct mql function for that: https://www.mql5.com/en/docs/series/ihighest
      Your case (put this in custom mql block):
      somevariable = iHighest(NULL, 0, 10, 1);

      Pictures of Charts – Idea’s
      Identify Highest Close of Last 10 Candles
      Hi Roar,
      The Problem
      Identify the highest close of last 10 candles
      starting at Candle id 1
      then store in variable.

      You suggested that there is a direct mql function for that: https://www.mql5.com/en/docs/series/ihighest
      Your case (put this in custom mql block):
      somevariable = iHighest(NULL, 0, 10, 1);
      Shared Project for Testing- https://fxdreema.com/shared/K62Z6eXkb
      0_1617568887302_Variable HighestClose.png

      I have been attempting to incorporate your suggestion however when testing I do not get the Highest close

      The comment test suggest it is simply counting which bar I am on and rotating through bar 1 to 10

      Any idea’s how we can fix this.

      Note: In fxDreema I created the variable HighestClose.
      When I create the custom MQL code I cannot seem to add the fxDreema variable so I
      Typed in the variable in ---
      HighestClose = iHighest(NULL,0,MODE_CLOSE,10,1);

      I simple don’t know.

      posted in Questions & Answers
      V
      VanceDavid
    • RE: identify Highest close of last 10 candles then store to variable

      @roar

      Thank you roar.

      I will research this solution (direct mql function) . I have never attempted custom mql block so we shall see how things work out.

      Thank you roar. I truly appreciate the help.

      VanceDavid

      posted in Questions & Answers
      V
      VanceDavid
    • identify Highest close of last 10 candles then store to variable

      I need help to:

      • Identify the highest close of last 10 candles
      • starting at Candle id 1
      • then store in variable.

      Thank you for helping.

      VanceDavid

      posted in Questions & Answers
      V
      VanceDavid
    • RE: Executed trade price store to variable

      @l-andorrà

      Thank you all for your suggestions
      Thank you l'andorrà for showing me how to solve the problem.

      I have tried to figure out what the PINK blocks are used for. They truly are an unknown and a mystery as to how I could use any of them.

      Thank you friends,
      VanceDavid

      posted in Questions & Answers
      V
      VanceDavid
    • Executed trade price store to variable
      • When a trade is executed how do I find the price at which it was executed?
        How do I store that price in a variable?
      posted in Questions & Answers
      V
      VanceDavid
    • Determine TAke Profit Point - Trade Point + 2 ATR

      I simply do not know where to find the right blocks in many cases; then there are logic issues.
      Shared Link: https://fxdreema.com/shared/GBNupf70e

      0_1617142237752_Constants and Variables.png

      1. [Block 2]
        • What does cross width do? If I change from 1 to 5 how is logic affected?
        • EMA9 {Candle id 1} x> EMA20 {Candle id 1}

      2. [Block 3]
        • I determine ATR for {Candle id 1}then store in a variable vATR_TradeBar

      3. I want to calculate variables for Stop Loss and take Profit (used in Buy Block 4)
        • How do I save the trade price into a variable (vTradePrice) (Don’t know where to obtain trade price
        • How do I save the trade lot size into a variable. (vTradeLotSize)

      • How do I add … vTake profit = vTradePrice + (2 time vATR_Tradebar) : I want to set Take Profit as Trade price plus 2 ATR

      • ??? How do I calculate vStopLoss = vTradePrice - (1 time vAtr_Tradebar): I want to set Stop loss as Trade Price minus 1 ATR
      Summary
      I do not know how to:
      • Find Trade Price then save trade price into variable
      • Find Trade Lot Size thensave Lot Size into variable
      • Calculate Take Profit Point = Add Trade Price + 2 Time AtR
      • Calculate StopLoss Point = Trade Price minus ATR to establish Stop Loss

      posted in Questions & Answers
      V
      VanceDavid
    • RE: Windows are messed up - Black Boarder Problem around blocks.

      Please ignore this post. I shut down computer and restarted and everything is ok. Appears problem is gone. Huhh.

      posted in Questions & Answers
      V
      VanceDavid
    • Windows are messed up - Black Boarder Problem around blocks.

      What has happened to fxdreama blocks. Yesterday everything was alright, now today the blocks are all surrounded by Black. This is a problem to attach blocks to each other because we don't see the connection on top and bottom.

      Using firefox and windows 10. Things have been alright for months until today.

      picture of Screen

      0_1615070390222_Windows are now messed p - Blacjk Boarder Problem.jpg

      posted in Questions & Answers
      V
      VanceDavid
    • RE: Fractal Creation - Errors will not compile

      @roar
      Thank you Roar.

      I know some of my limitations and I am a really bad editor. I simply so not see errors. I guess it is because I speed read and my mind skips over so much; kind of like I am a bit blind. ( Reviewed the blocks probably 6 times and always missed the small check mark.)

      I made the change and it compiles. Thank you so much. Once again you are the best.

      posted in Questions & Answers
      V
      VanceDavid
    • RE: Fractal Creation - Errors will not compile

      @lucivuur

      Thank you for your input LuciVuur.

      Roar made a couple of suggested changes which I incorporated . They did help but not completely.

      I have updated the project. The variables are shown in the post as an image.

      posted in Questions & Answers
      V
      VanceDavid
    • 1
    • 2
    • 1 / 2