Jump to content

easycrom

Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by easycrom

  1. Re: Open source FX Trading

     

    I dont know enough about programming to understand that code :( but I will give away the way I use this system manually

     

    Once I see the setup, I place the orders with an expiry of 24 hours.

     

    If the trade is profitable 24 hours later I trade in the opposite direction. Now for my least favourite part, if the trade goes against me to the point that it reaches the other end of the set up bar, I double my order and trade in the opposite direction with a trailing stop of 100.

     

    Now I have blown up several accounts using this method and 20:1 leverage per trade per currency, not one ended in me not being able to draw out my initial investement and a 10% profit though, but CLEARLY it needs improvement, and you can implement whatever stop losses you deem.

     

    The backtesting is heartbreaking as the current robot can double your account but ALWAYS ENDS UP IN A MARGIN CALL.

     

    A friend of mine recommended that I go long 10 pips above the high/low with a target of 100 pips and a stop loss of 50 pips.

     

    So there you have it, wishing you profitable trades.

  2. Re: Open source FX Trading

     

    I would opt for the more versatile solution but I honest have no idea how to implement it, and what is worse the EA works pretty well except for the multiple trades. Sometimes the multiple trades end in multiple profits but I like the idea of taking my money once and thats it.

  3. Re: How do I sum a range of values

     

    That is the rub of the system, the drawdown can be quite high as I did not input a stop loss and I am thinking that the system should not be traded with more than 3 to 1 leverage, sigh, and I personally favour hedging.

     

    So your returns are going to be relatively low but steady, but in testing the blinking method even works when trading the TITAN known as XAUUSD!

     

    Using 2008 to now with conservative method on GBPJPY a trader would have made 7,396 pips.

     

    Using 2008 to now with conservative method on XAUUSD and assuming that one pip is calculated as the value in the 1 cent position a trader would have made only trading long signals 28,290 pips. I chose long in this case as most sites pay interest if you go long XAUUSD.

     

    This is why I want to see if it works with live data, as it seems like a worthwhile system.

     

    Going to see what the system would look like on XAUUSD trading both long and short

  4. Re: How do I sum a range of values

     

    I exported the data from the meta trader history center into an excel spreadsheet, put in my logic and spent an entire weekend going through the data, and identifying the dates that met my parameters and testing various take profit methods.

     

    Finally refined the entry and exit to state that if an order was not filled within 24 hours then wait for another signal. Even if I had not put in place that conservative measure I would have still not had a losing trade but I figure that having an order filled and exited profitably after 24 hours when looking on a daily chart is too much of a risk for me.

  5. I want to sum the difference between the open and the close of a candle over 3 periods.

    With candle 1 being the most recent fully closed candle and candle 2 being the next most recent fully closed candle etc etc.

    Also can someone provide me with live data so that I can test a method that, sigh, and I know I should not be saying this:

    Has not in BACKTESTING returned one losing trade since 1999!!

     

    Anyway thanks for any help with either of these issues.

  6. Re: Open source FX Trading

     

    You are welcome, the backtest results for 2008 for GBPUSD and EURUSD using 20:1 leverage are good, 5k to 13k for GBPUSD and 5k to 17k for EURUSD. I just want someone to forward test it, as I have heard that demo prices are smoothed.

    Also a weakness of this system is that it uses no stop loss so implement your own money management rules.

  7. I have gotten so much from this site that I decided to share my EA.

    IF it is profitable for you, make a donation to an account I specify.

    If you modify let me know so we can test it; and if its better than my method, credit will be given to the modder and I will not ask for any donation.

     

    Logic of the ea ( ideally ): Calculate average ATR for 4 hour candles for currency of your choice for the previous year.

    Attach EA to 1 hour chart

     

    Caveat: I am too lazy to do this right now so if someone could get me a CSV file with live data it would be much appreciated.

     

    Any questions feel free to ask.

     

    I am not charging for this because you are not fools, I am not a scammer ( the website listed in the code is just for fun ), and KNOWLEDGE SHOULD BE SHARED FREELY.

     

    STRANGE I COULD NOT ADD THE ATTACHMENT CODE FOLLOWS

     

    //+------------------------------------------------------------------+
    //|                                                     easycrom.mq4 |
    //|                      Copyright © 2007, MetaQuotes Software Corp. |
    //|                                        [url]http://www.metaquotes.net[/url] |
    //+------------------------------------------------------------------+
    #property copyright "Dominic Henry"
    #property link      "www.*****.com"
    
    int MagicNumber = 10000;
    //extern double Range_ref =139;  // in points
    extern double Lots = 0.1;  // in points
    //+------------------------------------------------------------------+
    //| expert initialization function                                   |
    //+------------------------------------------------------------------+
    int init()
     {
    //----
      
    //----
      return(0);
     }
    //+------------------------------------------------------------------+
    //| expert deinitialization function                                 |
    //+------------------------------------------------------------------+
    int deinit()
     {
    //----
      
    //----
      return(0);
     }
    //+------------------------------------------------------------------+
    //| expert start function                                            |
    //+------------------------------------------------------------------+
    /*
    I need help creating an EA that will in order
    1) Calculate the difference between high and low of the last closed candle ( Range=Prev_CandleH - PrevCandleL)
    2) Compare this value to a a variable
    3) If the difference between high and low of the last closed candle is equal or greater than user assigned variable
    4) Execute BUY STOP at LOW of prev candle and execute SELL STOP at LOW of prev candle 
    5) Close pending order if not filled in 4 hours
    6) Take profit of 40 pips
    
    
    
    */
    
    int OrderCount(string symbol, int type)
    {
      int count=0;
      for(int i=0;i<OrdersTotal();i++)
      {
         if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
            continue;
         if(OrderSymbol()!=symbol)
            continue;
         if(OrderType()==type)
            count++;               
      }
      return(count);
    }
    
    
    double getRangeRef(string _symbol)
    {  // this one a simple approach.
      // furthermore, when attaching the EA to a char
      // we can customize the external variables to the corresponding symbol.
      if(_symbol=="EURUSDm" || _symbol=="EURUSD")  // Attention here: depending on the broker's symbol, it can be EURUSD, eurusd, ... 
         return(100);         // EURUSDm, here is because my broker provides these symbols for minis.
      if(_symbol=="EURGBP" || _symbol=="EURGBP")  // Attention here: depending on the broker's symbol, it can be EURUSD, eurusd, ... 
         return(100);   
      if(_symbol=="USDJPYm" || _symbol=="USDJPY")  // Attention here: depending on the broker's symbol, it can be EURUSD, eurusd, ... 
         return(100);          // this could be specified in a  external file, or something like that.
      if(_symbol=="EURJPYm" || _symbol=="EURJPY")  // Attention here: depending on the broker's symbol, it can be EURUSD, eurusd, ... 
         return(100); 
      if(_symbol=="GBPJPYm" || _symbol=="GBPJPY")  // Attention here: depending on the broker's symbol, it can be EURUSD, eurusd, ... 
         return(100);       
      if(_symbol=="AUDUSDm" || _symbol=="AUDUSD")  // Attention here: depending on the broker's symbol, it can be EURUSD, eurusd, ... 
         return(100);          // this could be specified in a  external file, or something like that.   
      if(_symbol=="GBPUSDm" || _symbol=="GBPUSD")  // Attention here: depending on the broker's symbol, it can be EURUSD, eurusd, ... 
         return(100);           // this could be specified in a  external file, or something like that.   
      if(_symbol=="USDCADm" || _symbol=="USDCAD")  // Attention here: depending on the broker's symbol, it can be EURUSD, eurusd, ... 
         return(100);   
      if(_symbol=="USDCHFm" || _symbol=="USDCHF")  // Attention here: depending on the broker's symbol, it can be EURUSD, eurusd, ... 
         return(100);     
      //return(139); //default value provided to every other pairs.   
    }
    
    
    int start()
     {
         double Range = (High[1]-Low[1])/10;      
         
         double Range_ref=getRangeRef(Symbol());
         if( Range>= Range_ref*Point) {
            int digits              =  MarketInfo(Symbol(),MODE_DIGITS);         
            double buy_price        =  NormalizeDouble(High[1]         , digits);
            double sell_price       =  NormalizeDouble(Low[1]          , digits);
            double buy_take_profit  =  NormalizeDouble(High[1]+400*Point, digits);
            double sell_take_profit =  NormalizeDouble(Low[1]-400*Point, digits);
            int ticket=0;
            
            // if orderstotal is huge number, we could spare time here.
            int longOrders  = OrderCount(Symbol(),OP_BUYSTOP)+OrderCount(Symbol(),OP_BUY);
            int shortOrders = OrderCount(Symbol(),OP_SELLSTOP)+OrderCount(Symbol(),OP_SELL);  
            
            if(longOrders==0)
            if(buy_price > Ask)  //buy stop must be above market price
            ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots, buy_price,3,0,buy_take_profit,"--",MagicNumber,TimeCurrent()+4*60*60,Green);
            if(ticket==-1)
               Print("error buystop = ", GetLastError());
               
            ticket=0;   
            if(shortOrders==0)
            if(sell_price<Bid) //sell stop must be below market price
            ticket = OrderSend(Symbol(),OP_SELLSTOP,Lots,sell_price,3,0,sell_take_profit,"--",MagicNumber,TimeCurrent()+4*60*60,Red);
            if(ticket==-1)
               Print("error sellstop = ", GetLastError());
         }         
         return(0);
     }
    //+------------------------------------------------------------------+

    -edited. if you like to share your code. its better if you add "code" on it.

    -and. you can have .hist or csv on this site

    www.alpari.com

     

    K

×
×
  • Create New...