Jump to content

matrixfx

Members
  • Posts

    20
  • Joined

  • Last visited

Posts posted by matrixfx

  1. Sorry for the colors, there were OK or does not metter too much.

    Honestly, there are some differences from what I saw yesterday, without data feeding. I should think again if we can find a use to this indicator. Anyway, I thank bgrtz for his help.

    Actually, what this indicator mesure is when the the change in price is made with a opposite change in volume. For example, if the price decrease with an increase in volume or if the price increase with a decrease in volume we have the red led. If the price increase were with an increase in volume we have blue red.

  2. Thanks a lot bgrtz. You have did a step forward Version 2 looks good, just should be changed the colors (blue to red and red to blue). I start testing it. Most likely should be added a trend indicator (like Price channel v1.2) as a filter, too. Let's see how its going.

    I wonder if we can increase the leds back for a visual back testing.

    Thanks again.

  3. I used MA Periods: 5; 8; 14. The main ideea is to cummulate their signals (blue for all for a pre-buy signal, red for all for a pre-sell signal). When 5 or 8 change their color may be the entry point, re-entry or compounding, but also a sign that the trend may be finished. I also use the ATR slope as a filter in the testing; if the signal is with a negativ ATR slope I would consider a reverse chance also. I may consider using a MTF filter if it will work well.

     

    I have tried to paste a print screen with my set-up but it did not take it.

    bgrtz, if you have any question please contact me. Many thanks again for your help and I'll keep in touch as things progress.

  4. Here it is the indicator code up-dated to be tested.

     

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

    //| Price-Volume Changes.mq4 |

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

    #property copyright "No copyright, 2011, bgrtz and matrixfx"

    #property indicator_separate_window

    #property indicator_buffers 6

    #property indicator_color1 Red

    #property indicator_width1 3

    #property indicator_color2 Blue

    #property indicator_width2 3

    #property indicator_color3 Gray

    #property indicator_width3 3

    #property indicator_minimum 0

    #property indicator_maximum 2

     

    extern int MA_Period = 14;

    extern int MA_Method = 0;

    extern int MA_Price = 6;

    string shortName = "Elasticity";

     

    double buffer1[];

    double buffer2[];

    double buffer3[];

    double valMA[];

    double valVol[];

    double valVolMA[];

     

     

    int init() {

    SetIndexBuffer(0, buffer1);

    SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 3);

    SetIndexLabel(0, "Elasticity");

    SetIndexBuffer(1, buffer2);

    SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 3);

    SetIndexLabel(1, "Inelasticity");

    SetIndexBuffer(2, buffer3);

    SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, 3);

    SetIndexLabel(2, "Idle");

    SetIndexBuffer(3, valMA);

    SetIndexStyle(3, DRAW_NONE);

    SetIndexBuffer(4, valVol);

    SetIndexStyle(4, DRAW_NONE);

    SetIndexBuffer(5, valVolMA);

    SetIndexStyle(5, DRAW_NONE);

     

    IndicatorShortName("Elasticity_"+MA_Period);

     

    return(0);

    }

     

     

    int start() {

    int i, limit = 1500;

     

    for (i=0; i<=limit; i++) {

    valMA = iMA(Symbol(), 0, MA_Period, 0, MA_Method, MA_Price, i);

    valVol = iVolume(Symbol(), 0, i);

    }

     

    for (i=0; i<=limit; i++) {

    valVolMA = iMAOnArray(valVol, 0, MA_Period, 0, MODE_SMA, i);

     

    if (((valVolMA - valVolMA[i+1]) / valVolMA[i+1]) / ((valMA - valMA[i+1]) / valMA[i+1]) > 0) {

    buffer1 = 1;

    buffer2 = EMPTY_VALUE;

    buffer3 = EMPTY_VALUE;

     

    } else if (((valVolMA - valVolMA[i+1]) / valVolMA[i+1]) / ((valMA - valMA[i+1]) / valMA[i+1]) <= 0) {

    buffer1 = EMPTY_VALUE;

    buffer2 = 1;

    buffer3 = EMPTY_VALUE;

     

    } else {

    buffer1 = EMPTY_VALUE;

    buffer2 = EMPTY_VALUE;

    buffer3 = 1;

    }

    }

    return(0);

    }

  5. Hi bgrtz,

     

    Thank you for your time and interest. Now the indicator it's working. I realized I did a mistake beacause the price and volume change values should be absolute value or modulus (http://en.wikipedia.org/wiki/Elasticity_%28economics%29), otherwise comparing with "1" doesn't make sense. The elasticity ideea I have it from the time I worked for my PhD from Harry Markovitz (who received the Nobel Price in 1990 I think).

     

    Anyhow, I was impressed how outstanding it is the indicator (the wrong one :)) in this form, so I decided to keep it and allocate more time to test and implement it. I just pray not to repaint (and I think there are no reasons) and to see it tomorrow performing as it did in the history.

  6. Thank you a lot, bgrtz! You are a pro! I will up date you with the results from my side.

    The code seems to have a small problem, if I press compile it's working as you showed me, if I try installing the indicator from MT4 I have just a red line and I should press compile each time I change something. Can you, please, help me out fixing it?

  7. The percentage of price elasticity will measure how rapidly the market responds to price changes. If the price elasticity is higher than one, then this means that the pair choosen is price elastic. When the price changes, there is a high corresponding response in number of contracts traded on the market. If the price elasticity is exactly equal to one, then that means that the pair is unit elastic, but that result is relatively rare. It is more common for the price elasticity to be lower than one. This means that the price is inelastic, and price changes will not have a corresponding effect on the number of contracts sold.

     

    Now, this is the theory, we need the indicator running to check it out and optimize the parameters.

  8. The formula for the coefficient of price elasticity of demand for a good is:

     

    E_d = {%change in quantity demanded}/{%change in price} = [Delta Q/Q]/[Delta P/P]

    Our quantity is the volume, the price I used the the weighted price. It also may be used as a version the ATR, just beeing aware the ATR can increase without a significant price change. For this reason I choose the price.

  9. soundfx,

    It should signal with lime led when we have elasticity (price change is higher then volume change; indi is >1) and magenta when we have inelasticity in the market. This may be a filter for entries and exits. Elasticity it is used in micro-economy to compare the price change from demand/supply, and also I saw some ideas using it in stock market, but I didn't find any indi on the market. The formula should be OK. The MAPeriod should be tested which one fits better.

    bgrtz,

    It didn't return the values and I have no leds open when it is launched.

    Thanks for replies. Rgds,

  10. I'm working to an indicator called elasticity, which may show us if the price starts to move reported to the volumes involved. The formula should be: (%of volume change/% of price cange) > 1 to have elasticity, <1 for inelasticity. I have an attempt I made today, it's almost done, but I'm stuck. Can somebody help me, please? Any help will be great appreciated.

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

    //| E.mq4 |

    //| |

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

     

     

    #property copyright ""

     

    #property indicator_separate_window

    #property indicator_buffers 4

    #property indicator_color1 Lime

    #property indicator_color2 Magenta

    #property indicator_color3 Gray

    #property indicator_width1 2

    #property indicator_width2 2

    #property indicator_width3 2

     

    #property indicator_minimum 0

    #property indicator_maximum 10

     

    extern color LimeZone = Lime; //Elasticity conditions

    extern color PinkZone = Magenta; // InelasticityConditions

    extern color GrayZone = Gray; // Not defined

    double Vol[];

    double MA[];

     

    string name;

    extern string TF = "-- Time Frame To Display --";

    extern int TimeFrame1 = 0;

    int TimeFrame2 = 60;

    int TimeFrame3 = 240;

    string TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN|0-CurrentTF";

     

    extern int MAPeriod=14;

    extern double BarLevl = 0;

    extern int range = 1;

    extern int ma_shift = 0;

    extern int ma_method = MODE_SMA;

    extern int applied_price = PRICE_WEIGHTED;

     

    extern int alertSwitch = 0; //0=OFF , 1=ON

    extern int alertShift = 0; // 0=change color current Bars, 1=chamge color previous Bar, ....

    //

    double buffer1[], buffer2[], buffer3[], VolSMA[];

    int lastABar;

     

     

     

    int init()

    {

    SetIndexStyle(0,DRAW_ARROW, 2); SetIndexArrow(0,167); SetIndexBuffer(0,buffer1); SetIndexEmptyValue(0,EMPTY_VALUE);

    SetIndexStyle(1,DRAW_ARROW, 2); SetIndexArrow(1,167); SetIndexBuffer(1,buffer2); SetIndexEmptyValue(1,EMPTY_VALUE);

    SetIndexStyle(2,DRAW_ARROW, 2); SetIndexArrow(2,167); SetIndexBuffer(2,buffer3); SetIndexEmptyValue(2,EMPTY_VALUE);

    SetIndexBuffer(3,VolSMA);

     

     

    TimeFrame1=MathMax(TimeFrame1,Period());

    TimeFrame2=MathMax(TimeFrame2,Period());

    TimeFrame3=MathMax(TimeFrame3,Period());

     

     

    IndicatorShortName("E_"+TimeFrame1);

     

     

    return(0);

    }

     

    int start()

    {

     

    datetime TimeArray1[], TimeArray2[], TimeArray3[];

    int i,shift,limit,y1=0, y2=0, y3=0, counted_bars=IndicatorCounted();

    double Vol[], MA[], VolSMA[];

     

    // Plot defined timeframe on to current timeframe

    ArrayCopySeries(TimeArray1,MODE_TIME,Symbol(),TimeFrame1);

    ArrayCopySeries(TimeArray2,MODE_TIME,Symbol(),TimeFrame2);

    ArrayCopySeries(TimeArray3,MODE_TIME,Symbol(),TimeFrame3);

     

    limit=Bars-counted_bars+TimeFrame1/Period();

    limit=Bars-counted_bars+TimeFrame2/Period();

    limit=Bars-counted_bars+TimeFrame3/Period();

    for(i=0,y1=0,y2=0,y3=0;i<limit;i++)

    {

    if (Time<TimeArray1[y1]) y1++;

    if (Time<TimeArray2[y2]) y2++;

    if (Time<TimeArray3[y3]) y3++;

     

    buffer1 = 0; buffer2 = 0; buffer3 = 0;

    /***********************************************************

    Add your main indicator loop below. You can reference an existing

    indicator with its iName or iCustom.

    Rule 1: Add extern inputs above for all neccesary values

    Rule 2: Use 'TimeFrame' for the indicator timeframe

    Rule 3: Use 'y' for the indicator's shift value

    **********************************************************/

    MA = iMA(NULL,TimeFrame1,MAPeriod,ma_shift,ma_method,applied_price,y1);

     

    Vol = iVolume(Symbol(),TimeFrame1,y1);

    VolSMA=iMAOnArray(Vol,Bars,MAPeriod,0,MODE_SMA,y1);

     

    buffer1=EMPTY_VALUE; buffer2=EMPTY_VALUE; buffer3=EMPTY_VALUE;

     

    if (((VolSMA[y1]-VolSMA[y1+1])/VolSMA[y1+1])/((MA[y1]-MA[y1+1])/MA[y1+1])>1) buffer1 = BarLevl;

    else

    if (((VolSMA[y1]-VolSMA[y1+1])/VolSMA[y1+1])/((MA[y1]-MA[y1+1])/MA[y1+1])<1) buffer2 = BarLevl;

    else buffer3 = BarLevl;

    }

    if (alertSwitch == 1 && Bars > lastABar) {

    if (buffer1[alertShift] != EMPTY_VALUE && buffer1[alertShift+1] == EMPTY_VALUE) {

    Alert("Elasticity, "+Symbol()+" , M_"+Period());

    lastABar = Bars;

    }

    if (buffer2[alertShift] != EMPTY_VALUE && buffer2[alertShift+1] == EMPTY_VALUE) {

    Alert("Inelasticity, "+Symbol()+" , M_"+Period());

    lastABar = Bars;

    }

    }

     

    return(0);

    }

  11. Hello all,

     

    I'm trying to use ArrayMaximum to return and use the maximum volume value in a 20 bar period. The indicator is compiled, but if I delete the ATR condition (ATR_0>ATR_1), it doesn't work properly. In fact I think it didn't return the maximum value from the array. Can a programmer help me integrating the ArrayMaximum in the indicator. Thank you a lot for any help!

     

    Here it is the code:

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

    //| R2.mq4 |

    //| Copyright © 2011 |

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

     

     

    #property copyright ""

     

    #property indicator_separate_window

    #property indicator_buffers 3

    #property indicator_color1 Lime

    #property indicator_color2 Magenta

    #property indicator_color3 Gray

    #property indicator_width1 2

    #property indicator_width2 2

    #property indicator_width3 2

     

    #property indicator_minimum 0

    #property indicator_maximum 10

     

    extern color LimeZone = Lime; // Strong Reverse conditions

    extern color MagentaZone = Magenta; // Medium Reverse Conditions

    extern color GrayZone = Gray; // Weak Reverse Conditions

    double ATR_0;

    double ATR_1;

    double V_1_0;

    double V_1_1;

    double V_1_2;

    double V_1_3;

    double V_1_4;

    double V_1_5;

    double V_1_6;

    double mv;

     

    string name;

    extern string TF = "-- Time Frame To Display --";

    extern int TimeFrame1 = 0;

     

    extern string TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN| 0-CurrentTF";

     

    extern double BarLevl = 0;

     

    extern int ATRPeriod = 14;

    extern int VPeriod1 = 21;

    extern int V1 = 50;

    extern int V2 = 20;

     

    extern int alertSwitch = 0; //0=OFF , 1=ON

    extern int alertShift = 0; // 0=change color current Bars, 1=chamge color previous Bar, ....

    //

    double buffer1[], buffer2[], buffer3[];

    int lastABar;

     

     

     

    int init()

    {

    SetIndexStyle(0,DRAW_ARROW, 2); SetIndexArrow(0,167); SetIndexBuffer(0,buffer1); SetIndexEmptyValue(0,EMPTY_VALUE);

    SetIndexStyle(1,DRAW_ARROW, 2); SetIndexArrow(1,167); SetIndexBuffer(1,buffer2); SetIndexEmptyValue(1,EMPTY_VALUE);

    SetIndexStyle(2,DRAW_ARROW, 2); SetIndexArrow(2,167); SetIndexBuffer(2,buffer3); SetIndexEmptyValue(2,EMPTY_VALUE);

     

     

    TimeFrame1=MathMax(TimeFrame1,Period());

     

    IndicatorShortName("Vol_"+TimeFrame1);

     

     

    return(0);

    }

     

    int start()

    {

     

    datetime TimeArray1[], TimeArray2[], TimeArray3[];

     

    int i,shift,limit,y1=0, counted_bars=IndicatorCounted();

    double ATR_0, ATR_1;

    double V_1_0, V_1_1, V_1_2, V_1_3, V_1_4, V_1_5, V_1_6, mv;

     

    // Plot defined timeframe on to current timeframe

    ArrayCopySeries(TimeArray1,MODE_TIME,Symbol(),Time Frame1);

     

    limit=Bars-counted_bars+TimeFrame1/Period();

     

    for(i=0,y1=0;i<limit;i++)

    {

    if (Time<TimeArray1[y1]) y1++;

     

    buffer1 = 0; buffer2 = 0; buffer3 = 0;

    /************************************************** *********

    Add your main indicator loop below. You can reference an existing

    indicator with its iName or iCustom.

    Rule 1: Add extern inputs above for all neccesary values

    Rule 2: Use 'TimeFrame' for the indicator timeframe

    Rule 3: Use 'y' for the indicator's shift value

    ************************************************** ********/

    ATR_0 = iATR(NULL,TimeFrame1,ATRPeriod,y1);

    ATR_1 = iATR(NULL,TimeFrame1,ATRPeriod,y1+1);

     

    V_1_0 = iVolume(Symbol(),TimeFrame1,y1);

    V_1_1 = iVolume(Symbol(),TimeFrame1,y1+1);

    V_1_2 = iVolume(Symbol(),TimeFrame1,y1+2);

     

    double Vol = iVolume(Symbol(),TimeFrame1,i);

    mv = ArrayMaximum(Vol, VPeriod1, i+1);

     

    buffer1=EMPTY_VALUE; buffer2=EMPTY_VALUE; buffer3=EMPTY_VALUE;

     

    if (V_1_0>(mv*((V1+100)/100)) && (ATR_0>ATR_1)) buffer1 = BarLevl;

    else

    if ((V_1_0>((V_1_1+V_1_2)/2)*((V2+100)/100)/2)) buffer2 = BarLevl;

    else buffer3 = BarLevl;

    }

    if (alertSwitch == 1 && Bars > lastABar) {

    if (buffer1[alertShift] != EMPTY_VALUE && buffer1[alertShift+1] == EMPTY_VALUE) {

    Alert("Strong Reverse conditions, "+Symbol()+" , M_"+Period());

    lastABar = Bars;

    }

    if (buffer2[alertShift] != EMPTY_VALUE && buffer2[alertShift+1] == EMPTY_VALUE) {

    Alert("Medium revese conditions, "+Symbol()+" , M_"+Period());

    lastABar = Bars;

    }

    }

     

    return(0);

    }

  12. Can any programmer make an alert from these two indicators (each one has its own alert, just to cummulate both alerts)? Stochastic should stay a MTF indicator, EMA just for current TF, when both go in the same direction should alert the pair (symbol), the timeframe and the bid price. The signal is better given by arrows.

     

    This alone will give us very good signals/alerts and it is a great tool, if it is possible to introduce the Stochastic "Signal line" (current TF) to come from (0;35) area for long and from (100;65) area for shorts, this will make it highly accurate. What means to come from (0;35) area? The previous Stochastic "Signal line" Bottom for long (or Top for short - (100;65)) to belong to these areas. Here it is about the current Sto, EMAs crossover is current TF, too, and the other MTF Stochastic (H1 for M15 current TF or M30 for M5 current TF) are just for Main and Signal (K and D) lines crossover - we'll take in consideration the crossover lines' filter between (0;80) for long and (20;100) for short; we'll accept the signals for long between (80;100) even if the STO lines crossover against us; up-side down for short (it is a EMA 5-8 signal with two filters: current Sto and MTF Sto).

     

    If any programmer is interested doing it I can provide more info. For now I attach the two indicators with their alerts, if we can only cummulate the two alerts that's great and look for the other signals our-selfs, that's enough to be able to follow 12 pairs or more. If we can do all filters that's amazing because we'll get alert just when we should trade! But sure, we can live without it if it's complicated.

     

    I attach the indicators here: hxxp://[email protected]/dir/34832936/36d3ce2e/sharing.html

     

    Thanks a lot for your help.

  13. Re: Dashboard alert

     

    Thank you for your observation and help. I've done some changes, there were some unbalanced pairs in the initial indicator. I didn't check the indicator you posted, but to be sure I've posted the link anybody can download the correct one:

    hxxp://[email protected]/file/249984937/c944b30e/T101_dashboard_new.html

     

    I don't know if it's easy or not to setup the alert, but I know for sure it will pay back all the efforts. It will give you the chance to be present in all major moves in the market and avoid entering into trades that accidentally and for short term move into a certain direction due to hedgers or S/L hunters. In other words, you'll know when to trade to catch the trend from its inception with lower risk and better results. Also you can notice there are few hours trends. Additionally, anyone who tried setup alerts to multiple pairs knows how confusing is receiving too many alerts since the confirmation with other indicators does not happened so often. This alert it will happened when you really have something to see in the most situations.

    I thank you for any help building this alert.

  14. Using T101 Dashboard we can figure out timely and safely the trend for a few hours. Sure correlating with your trading system. The point is to know when there are significant changes over all market, trend change for some pairs and be ready in time for trading. That happened few times a day and most likely we want to be in front of our computers that time.

     

    Can anybody with programming skills to set up an alert when the signal (SIG) from the last raw (current column – the left one) changes from Long to Short or from Short to Long? It does not matter if the trend is Long/Short weak or strong, we consider just the change from long to short (no matter if it is weak or strong).

     

    I have attached the T101 Dashboard indicator. If somebody is interested on T101 system you should go to his thread. I do not trade this system. However I like and use this indicator and thank T101 and the programmer who did it for this excellent tool.

     

    I thank you in advance for your help, C

×
×
  • Create New...