fxDreema

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

    runekeeper

    @runekeeper

    0
    Reputation
    422
    Profile views
    5
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    runekeeper Unfollow Follow

    Latest posts made by runekeeper

    • I want to convert points into pips.

      I'm really confused about it.
      I want to place pending buy orders in grid with a distance of 0.5*ATR. But 0.5 ATR would be in points and the pending grid block uses pips. So, how do I go about this?

      What really makes this confusing is the point format rules set by the fxdreema platform. I would have just used a custom mql4 block that stores this 0.5ATR/MarketInfo(Symbol(),MODE_POINT) if it were a 4digit broker and 0.5ATR/(10*MarketInfo(Symbol(),MODE_POINT)) if it were a 5digit broker.

      But having seen the point format rules confuses me. Someone englighten me.

      posted in Questions & Answers
      R
      runekeeper
    • RE: Compile Error: Constant expected

      @uchiha i got it to work already actually. I didnt know how. I just redid everything editing the inputs that only matter. (I think if you can an input parameter, then switch it back to a different parameter, it messes with the codes.)

      posted in Questions & Answers
      R
      runekeeper
    • RE: Divide by zero bug

      @fxDreema My sl isn't zero. I noticed that whatever I sl i put, this line of code always appear. SL=0 is always there. try to check your codes. I even tried setting it to something else like 2 or 5 or 0.001 and still nothing.

      posted in Bug Reports
      R
      runekeeper
    • Divide by zero bug

      EA works fine on live trading but I couldn't back test it. MT4 journal says :

      2017.06.14 18:19:03.285	2017.04.18 05:05:00  ZigZag Strategy v1 USDCHF,M30: zero divide in 'ZigZag Strategy v1.mq4' (3696,105)
      

      I peeked into the EA code and found this at exactly 3969'th row.

         else if (mode=="equityRisk")     {size=((value/100)*AccountEquity())/(sl*((TickValue/ticksize)*point)*PipValue(symbol));}
      

      This is from here:

      double DynamicLots(string mode="balance", double value=0, double sl=0, string align="align", double RJFR_initial_lots=0)
      {
         double size=0;
         string symbol=GetSymbol();
         double LotStep=MarketInfo(symbol,MODE_LOTSTEP);
         double LotSize=MarketInfo(symbol,MODE_LOTSIZE);
         double MinLots=MarketInfo(symbol,MODE_MINLOT);
         double MaxLots=MarketInfo(symbol,MODE_MAXLOT);
         double TickValue=MarketInfo(symbol,MODE_TICKVALUE);
         double point=MarketInfo(symbol,MODE_POINT);
         double ticksize=MarketInfo(symbol,MODE_TICKSIZE);
         double margin_required=MarketInfo(symbol,MODE_MARGINREQUIRED);
         
         if (mode=="fixed" || mode=="lots")     {size=value;}
         else if (mode=="block-equity")      {size=(value/100)*AccountEquity()/margin_required;}
         else if (mode=="block-balance")     {size=(value/100)*AccountBalance()/margin_required;}
         else if (mode=="block-freemargin")  {size=(value/100)*AccountFreeMargin()/margin_required;}
         else if (mode=="equity")      {size=(value/100)*AccountEquity()/(LotSize*TickValue);}
         else if (mode=="balance")     {size=(value/100)*AccountBalance()/(LotSize*TickValue);}
         else if (mode=="freemargin")  {size=(value/100)*AccountFreeMargin()/(LotSize*TickValue);}
         else if (mode=="equityRisk")     {size=((value/100)*AccountEquity())/(sl*((TickValue/ticksize)*point)*PipValue(symbol));}
         else if (mode=="balanceRisk")    {size=((value/100)*AccountBalance())/(sl*((TickValue/ticksize)*point)*PipValue(symbol));}
         else if (mode=="freemarginRisk") {size=((value/100)*AccountFreeMargin())/(sl*((TickValue/ticksize)*point)*PipValue(symbol));}
         else if (mode=="fixedRisk")   {size=(value)/(sl*((TickValue/ticksize)*point)*PipValue(symbol));}
      
         else if (mode=="fixedRatio" || mode=="RJFR")
      

      Apparently, "sl" is set to 0 and then used as denominator on equity risk, balancerisk, freemarginrisk, and fixedrisk.

      What is the fix for this? Should I put sl=0.0001 instead or what do I do? is this a fundamental flaw in the code? What should I do?

      EDIT:

      I turned off blocks and found that the error is coming from the BUY/SELL PENDING block. Kindly fix this asap.

      posted in Bug Reports
      R
      runekeeper
    • Compile Error: Constant expected

      The problem seems to be because of the constants that I use. If I hardcode the values, there is no problem. However, if I use the "risk" "cutloss_pips" & "trailing_pips" constant, the project doesn't compile as ex4

      Please help me.
      [Click here to see my project]

      Here are my constants:!

      0_1497231543707_Capture.PNG

      EDIT:

      I got the "Cutloss_pips" and "Trailing_Pips" to work. Apparently, I should choose the "custom(pips)" mode "I MEAN" "this value, as is."
      0_1497272230888_stoploss.PNG

      The RISK is still a problem though.
      0_1497272306833_risk.PNG

      HOW DO I SOLVE THIS?

      posted in Questions & Answers
      R
      runekeeper