Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

nilu_2005

Members
  • Content Count

    5
  • Joined

  • Last visited

Personal Information

  • First Name
    TradersLaboratory.com
  • Last Name
    User
  • City
    Aurangabad
  • Country
    India
  • Gender
    Male

Trading Information

  • Vendor
    No
  1. Right now I have coded this MQL code for above system. val_high=High[iHighest(NULL,60,MODE_HIGH,6,0)]; // highest high val_low=Low[iLowest(NULL,60,MODE_LOW,6,0)]; // lowest Low res=iMA(NULL,0,Period_EMA,0,MODE_EMA,val_high,0); // variable res sup=iMA(NULL,0,Period_EMA,0,MODE_EMA,val_low,0); // variale sup if (iHigh(NULL,60,0)>res) // Current bar high crosses above res { a=1; } else { a=0; } if(sup>iLow(NULL,60,0)) // sup crosses above current bar Low { b=1; } else { b=0; } if (condition for buy) // { // Opn_B=true; // Cls_S=true; // } if (condition for sell) // { // Opn_S=true; // Cls_B=true; // } I want to know how to calculate or start counting number of bars since certain condition true for sometime till false value set. Say current close is greater than moving average close for say 5 bars in 1 hour chart including current bar when condition found to be true. How to calculate this number of "5" bars. I think this will solve my last code of part if I am able to count this numbers of bars after condition true till condition false .
  2. Hello, I need help on this EA. Actually I already got system in Amibroker TA. I am trying to code same system as Metatrader EA. Below is amibroker code(AFL) for system that I want to code as EA. As you can see there is external parameter ("no") which can be selected by user is an integer value. Calculation of lines/variables RES & SUP (Resistance & Support) “res” can be calculated using EMA of period 3 & PRICE will be highest high price of last 7 bars. This 7 bars value is an integer value which set by external parameter by user “no”. Same goes for “sup” which is EMA of period 3, But only difference is that price of EMA calculation is lowest low price of last 7 bars. Now variable “a” will set to “1” or “0” based on the crossing of current bars high & variable “res”. For variable “b” will set to “1” or “0” based on the crossing of current bars low & variable “sup”. Here is definition of this “CROSS” afl code. Now the variable “state” which also can be set to “1” or “0” based on following condition. BarsSince(a) : Calculates the number of bars (time periods) that have passed since ARRAY was true (or 1) in this case array was variable “a” BarsSince(b) : Calculates the number of bars (time periods) that have passed since ARRAY was true (or 1) in this case array was variable “b”. state = IIf(BarsSince(a)<BarsSince(b),1,0); Now I created EA based on above system. I have already used MQL code from MQL Programming Guide named tradingexpert. Means there is all code for Oder & Money Management. But my knowledge with MQL is not good. So I am not able to covert trading system into MQL code. As you can see attached MQL. I have stuck on trading system start part. When If this afl condition true => buy=cover=state>Ref(state,-1); in MQL I follow If condition for sell true=> sell=short=state<Ref(state,-1); in MQL I follow Please download attached MQL code file & Amibroker chart. I need help on converting same Amibroker AFL code into MQL code at the Trading system start position in the MQL code. right now I am not able to get same results in Metatrader which was I am getting in Amibroker. Please, Can any experienced MQL programmer help to resolve this code issue? Note: This system generates buy/sell without vanishing. When buy/sell comes at some point it stays there so no fake signals. Thank You tradingexpert.mq4
  3. Do you have this code for Esignal or Amibroker?
  4. This code is working fine in Amibroker. Thanks trader_08 for sharing this code.
  5. If AFL version of Amibroker is available, please post it.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.