Jump to content

apresau

Members
  • Posts

    13
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by apresau

  1. "Repaint" can be a loosely-used term.

    What I do to see how an indicator behaves is to watch it live on the strategy tester.

    For those of us who may be new to the MetaTrader platform, here's how I do it -

     

    Open the strategy tester (View -> Strategy Tester)

    Select any EA (we're not interested in the trades)

    Select a short timeframe (too short and the chart is too choppy; too long and the process is too slow).

    Select Model - Every Tick.

    Select currency pair and dates from a live chart that are typical of the market you want to test (e.g. ranging, trending).

    Apply the pair and those dates to the Strategy Tester.

    Select Visual Mode.

    Hit Start.

    When the tester chart is running, drag the indicator in question onto the chart.

    Watch the antics.

     

    Hope it helps someone.

  2. Here is a simple indicator that records the spread at the bar open and the maximum during the bar.

     

    http://www.4shared.com/get/RrcCGsGG/Spread_Histo.html

     

    I wrote it to to record any spread anomalies (i.e. spikes that occur outside news events or end of week)

    If you put it on a separate 1 min chart of the pair you're trading, if a very large spike triggers your SL,

     

    you can use a screenshot when discussing it your broker (the 1 min TF makes it easier for the broker to locate the precise event).

     

    Here is an example of an anomalous spike -

    http://www.4shared.com/photo/RNvsV1Du/gbpusd_m15_-_30-11-10.html

    (this event took some locating as the broker had to search for it tick by tick over a 15 min period - hence the need for the 1 min chart)

     

    One thing to keep in mind is that Metatrader doesn't store spread data, so a screen refresh will lose the

    indicator history, and the indicator will then rebuild its history again bar by bar.

     

    The wide red histo bar is the opening spread and the thin yellow histo bar is the maximum spread.

     

    Hope you find it helpful.

     

    apresau

  3. Hi folks,

    Thanks for the feedback - very kind of you.

    To make it easier, I've opened a mediafire account.

    The indicator has been tidied up and put here -

     

    http://www.mediafire.com/?jjwdn9dxb0a4fb6

     

    (should have done this before - sorry)

     

    Purely mechanical strategies (no trader discretion involved)

    can usually be coded this way for testing.

     

    I don't mind trying others if you need them.

  4. Strategies don't come much simpler than this.

    To quickly check the strategy against different pairs, I wrote a histogram indicator.

    I'm not permitted to post attachments, so here's the code -

     

    //+------------------------------------------------------------------+

    //| RSI_MA Cross Histo.mq4 |

    //+------------------------------------------------------------------+

    #property indicator_separate_window

    #property indicator_buffers 2

    #property indicator_color1 SteelBlue

    #property indicator_style1 STYLE_SOLID

    #property indicator_width1 2

    #property indicator_color2 Crimson

    #property indicator_style2 STYLE_SOLID

    #property indicator_width2 2

     

    //---- input parameters

    extern int RSI_Period = 21;

    extern int MinRSIcross = 0;

    extern int FastMaPeriod = 5;

    extern int SlowMaPeriod = 12;

    extern int MaType = 1;

    extern int MinMAcross = 0;

    extern int shift = 1;

     

    //---- indicator buffers

    double UpHisto[];

    double DnHisto[];

     

    double points;

    //+------------------------------------------------------------------+

    //| Custom indicator initialization function |

    //+------------------------------------------------------------------+

    int init()

    {

    //---- indicators

    SetIndexBuffer(0,UpHisto);

    SetIndexStyle(0,DRAW_HISTOGRAM);

    SetIndexBuffer(1,DnHisto);

    SetIndexStyle(1,DRAW_HISTOGRAM);

     

    //----

    if(Digits==3 || Digits==5)

    points = Point*10;

    else points = Point;

     

    return(0);

    }

    //+------------------------------------------------------------------+

    //| Custom indicator deinitialization function |

    //+------------------------------------------------------------------+

    int deinit()

    {

    //----

     

    //----

    return(0);

    }

    //+------------------------------------------------------------------+

    //| Custom indicator iteration function |

    //+------------------------------------------------------------------+

    int start()

    {

    if (Bars <= 10) return (0);

    int counted_bars;//=IndicatorCounted();

    if(counted_bars<0) return(-1);

    //if(counted_bars>0) counted_bars--;

    int limit=Bars-counted_bars;

    //----

    for (int i = limit; i >= 0; i--) {

    double RSI = iRSI(NULL,0,RSI_Period,PRICE_CLOSE,i+shift);

    double FastMa = iMA(NULL,0,FastMaPeriod,shift,MaType,PRICE_CLOSE,i);

    double SlowMa = iMA(NULL,0,SlowMaPeriod,shift,MaType,PRICE_CLOSE,i);

     

    UpHisto = 0;

    DnHisto = 0;

    if(RSI>50+MinRSIcross){

    if(FastMa>SlowMa+MinMAcross*points){

    UpHisto = 1;

    }

    }

    if(RSI<50-MinRSIcross){

    if(FastMa<SlowMa-MinMAcross*points){

    DnHisto = 1;

    }

    }

    }

    //----

     

    //----

    return(0);

    }

     

    //+------------------------------------------------------------------+

     

    If long conditions are met, a blue histo bar shows.

    If short conditions are met, a red histo bar shows.

    If conditions are not met, no bar.

     

    MinRSIcross and MinMAcross are included to filter some of the false trades.

    (MinMAcross is in pips, adjusted for 4- and 5-digit brokers)

    The shift variable is included because MA crosses often don't confirm

    until the open of the next bar (hence the default value of 1)

     

    Like most MA crosses, it seems best suited for longer trends.

     

    enjoy

  5. Hi Diesel,

     

    Interesting idea.

    I wrote an indicator to see what it would look like.

    http://www.4shared.com/file/UM04Q-NH/H_L_Trend.html

     

    http://www.4shared.com/photo/-E3jCIlE/eurusd.html

     

    The top histo is the result - blue for uptrend, red for downtrend, nothing for no trend i.e. consolidating.

    The second histo shows the continuous setting, showing the overall trend.

    The MinPips variable defines the distance above/below the previous bar.

     

    Trend filters are difficult and I’ve yet to see a truly effective one; it seems to be a compromise between sensitivity to the trend and delay due to filtering.

     

    The bottom histo is one of my attempts.

    It’s pretty ordinary, but someone may like to play with it.

    http://www.4shared.com/file/KQGfniC6/Trend_Filter.html

     

    Edit:

    I don't think the inserted picture is showing, so here's the url

    http://www.4shared.com/photo/-E3jCIlE/eurusd.html

  6. Monitoring the spread is important.

     

    If you scalp trade, you need to know when to trade i.e. what times have low spreads.

     

    If you are looking for a broker, you need to know if the spreads are consistent.

     

    If you get stopped out by a spike with exceptionally high spread, you need a record of that event to put your case to the broker.

    It happens - check out this image http://www.4shared.com/photo/RNvsV1Du/gbpusd_m15_-_30-11-10.html

    See the spike in the spread? Notice that the time (GMT+2) was not during a low liquidity period?

    If you'd entered short in the previous bar with a 30 pip TP, you would have successfully exited the trade with a substantial loss.

    I actually contacted the broker about this particular example. They confirmed the spike by going through their tick data history. This took a fair bit of time (there are a lot of ticks in 15 mins), so it's better to show them a 1 min screenshot.

     

    Now for the nuts and bolts.

    I wrote the simple indicator in the image to monitor the spread. The red histogram is the spread at the bars' open and the thin yellow histogram is the maximum spread. (you'll notice on some pairs that the opening spread is substantially lower than the maximum)

     

    Keep in mind that Metatrader keeps no spread history, so the indicator builds up bar by bar.

    If you refresh the indicator or change timeframes or turn off the chart, the indicator will clear itself and you'll be back to square one.

     

    The indicator shows real pip values, so that 30 pips in a 5-digit chart reads 3.0 as it would in a 4-digit chart.

     

    The best way to use the indicator would be to run it in the chart that you're trading (this would alert you to a pip-spike event) and run it on a separate 1 min chart as a reference in case you need to take a screenshot for your broker.

     

    The indicator is here http://www.4shared.com/file/RrcCGsGG/Spread_Histo.html

     

     

    note to moderator - not sure if this is in the right section

    could you please move it if it's not

    Thanks

×
×
  • Create New...