fxDreema

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

    Posts made by alidavoodi

    • RE: array out of range error

      @tec-nacks Thanks for letting me know
      I'll test it now.

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: array out of range error

      @tec-nacks
      Thank you

      Do you know when this happened
      Because I don't think it happened until yesterday...

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: array out of range error

      Hi FXDreema team, @fxDreema
      I'm encountering an issue with an EA generated by FXDreema, specifically an "array out of range" error in the OnChartEvent, OnTimer function.
      This seems to happen when I switch timeframes, and I believe it’s related to the generated code rather than anything I’ve added.
      Here’s the relevant code:

      void OnChartEvent(
          const int id,         // Event ID
          const long& lparam,   // Parameter of type long event
          const double& dparam, // Parameter of type double event
          const string& sparam  // Parameter of type string events
      )
      {
          //-- write parameter to the system global variables
          FXD_ONCHART.id     = id;
          FXD_ONCHART.lparam = lparam;
          FXD_ONCHART.dparam = dparam;
          FXD_ONCHART.sparam = sparam;
      
          //-- run blocks
          int blocks_to_run[] = {39,52,60,62,64,66,68,70,72,74,76,78,80,81,85,86,88,90,92,94,96,101,115,127,131,137,139,142,143,150,156,163,165,177,185,187,191,202,213,221,226,229,231,237,249,251,255,258,263,269,282,284,290,301,303,309,320,322,334,343,349,356,359,367,374,381,419,425,463,465,468,469,470,471,472,476,477,570,572,573,599,600,602,604,606,608,610,611,612,617,618,619,623,624,625,629,630,633,634,635,639,642,643,662,668,669,672,673,674,678,679,682,684,686,688,690,692,693,694,698,699,704,705,744,745,754,772,774,776,778,780,782,784,786,788,828,830,832,834,858,861,862,863,864,889,892,895,897,903,941,963,965,969,971,973,976,978,980,992,997,1015,1017,1019,1025,1026,1028,1031,1033,1046,1066,1069,1082,1098,1153,1159,1163,1167,1171,1176,1177,1182,1188,1189,1190,1191,1196,1197,1198,1199,1204,1205,1206,1207,1211,1212,1213,1214,1219,1240,1242,1270,1271,1272,1273,1279};
          Print(ArraySize(blocks_to_run));
          Print("Size of _blocks_: ", ArraySize(_blocks_));
          for (int i=0; i<ArraySize(blocks_to_run); i++) {
              _blocks_[blocks_to_run[i]].run();
          }
      
          return;
      }
      
      

      To debug, I added some print statements:

      Print(ArraySize(blocks_to_run)); returns 205, which seems correct.
      Print("Size of blocks: ", ArraySize(blocks)); returns 1301 normally, but when I switch timeframes, it drops to 0, and that’s when the “array out of range” error occurs.

      I’m using MetaTrader 5. Could you please take a look and suggest a fix or workaround?
      Thanks for your help!

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: check profit

      Dear friend, now the conditions that you placed will only be checked by EA and in the same market on which the EA was run.
      To check all markets and all trades, make the changes I specified in the picture.

      Screenshot 2024-01-11 115618.png

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: Transformation of profit/loss into price level

      @alidavoodi
      https://fxdreema.com/shared/1gX0Gs4zc

      Nasdaq:
      nq.png

      EURUSD:
      eur.png

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: Transformation of profit/loss into price level

      Hello @roar
      I want to know the amount of tp and sl in currency (not in price or pip).

      I read your post and created a project based on it.
      But unfortunately, it does not work properly in different markets.
      I am sending the picture of the result in Eurusd and Nasdaq market as an example.

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: amount of tp and sl in currency

      @l-andorrà Thank you
      I found a post on @roar's profile that I think has my answer.
      https://fxdreema.com/forum/topic/17851/transformation-of-profit-loss-into-price-level

      I will check it more to find a suitable solution.

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: amount of tp and sl in currency

      @l-andorrà Thanks for your help...
      Is there a specific formula for different markets? If you know a suitable reference for the calculation formula in different markets, I would be grateful if you could send it to me.

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: HOW CAN I DRAW A VERTICAL LINE IMMEDIATELY A CONDITION IS MET

      @l-andorrà thank you
      My problem is solved
      The solution is to use ChartRedraw();

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: amount of tp and sl in currency

      Like this photo
      Screenshot 2023-11-18 021222.png

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • amount of tp and sl in currency

      Hello
      I want to know the amount of tp and sl in currency (not in price or pip).
      Is there a solution to this issue?

      Please guide me in this regard.
      thanks a lot
      @fxDreema

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: add immediately H-Line

      @roar
      Thank you for your guidance

      Your solution was completely correct and my problem was solved.
      🙏 🙏 🙏

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: add immediately H-Line

      and I create the blocks in the "on chart" tab
      But after clicking on the button, one tick later, the commands I have written are executed...

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • add immediately H-Line

      Hello
      I have a problem and I tried every method to no avail...
      I add a button in the "on chart" section and specify that when it is clicked, it will add a line on the chart.

      But when I click on the button in Metatrader, it takes a tick to add the line. But I want the line to be added immediately and not wait a tick.
      @fxDreema

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: HOW CAN I DRAW A VERTICAL LINE IMMEDIATELY A CONDITION IS MET

      @l-andorrà Thank you for your answer
      I create the blocks in the on chart tab
      But after clicking on the button, one tick later, the commands I have written are executed...

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • RE: HOW CAN I DRAW A VERTICAL LINE IMMEDIATELY A CONDITION IS MET

      Hello
      I have a problem and I tried every method to no avail...
      I add a button in the "on chart" section and specify that when it is clicked, it will add a line on the chart.

      But when I click on the button in Metatrader, it takes a tick to add the line. But I want the line to be added immediately and not wait a tick.
      @fxDreema

      posted in Questions & Answers
      alidavoodi
      alidavoodi
    • 1 / 1