fxDreema

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

    Best posts made by willramsey

    • RE: Buttons don't work during backtesting

      @bagheria For backtests, there is a "If Testing" block. Unfortunately with the backtester, OnChart doesn't work with buttons, but OnTick does. So if you want to backtest with it, you need to have an If Testing block, connected to the rest of your logic OnTick.

      i.e. This is a old example with just a simple buy button, which works in the backtester.
      https://fxdreema.com/shared/jvHegkKHc

      posted in Questions & Answers
      willramsey
      willramsey
    • RE: Best way to set Delay and Modelling functions while back testing

      Whenever doing backtesting, you should always include some kind of delay, if not random. You're orders in live markets are never instant.
      Additionally, any test that's not based on real-ticks or tick-data is not good and shouldn't be taken seriously.
      There are still other factors such as how it trades. Does it scalp? Does it have a tight trailing stop? All these things matter. Additionally, you should add commissions to your backtest. Some kind of swaps too if the strategy holds trades through the next day.

      Lastly, and most important, just because these things are included, it still doesn't mean it's going to perform the exact same way in live, but it should be a close representation.

      posted in Questions & Answers
      willramsey
      willramsey
    • RE: Best way to set Delay and Modelling functions while back testing

      To add commissions, you can click this button and input the commissions your broker charges. I can try to find an article to link if it's confusing to you or you can probably find an article in a few minutes on how to do it. Commissions.png

      posted in Questions & Answers
      willramsey
      willramsey
    • RE: Help - Custom MQL Code

      I messed with creating it a different way and this worked just as well with less code . The if statement just checks the current status and if its on, then it toggles the button. Otherwise it does nothing. There is no custom function to make or anything.

      Screenshot 2023-12-11 084504.png

      // Global Variables, includes
      
      #include <WinUser32.mqh>
      #import "user32.dll"
      int GetAncestor(int, int);
      #define MT4_WMCMD_EXPERTS 33020
      #import
      
      //  Main Code
      
      if (IsTradeAllowed()){
      int main = GetAncestor(WindowHandle(Symbol(), Period()), 2/*GA_ROOT*/);
      PostMessageA(main, WM_COMMAND, MT4_WMCMD_EXPERTS, 0);
      }
      
      
      posted in Questions & Answers
      willramsey
      willramsey
    • 1 / 1