DailyFX Home | Español | Français | 中文 | Deutsch | Italiano | العربية | Sverige | Ελληνικά


+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Block is offline Gold Member Block is an unknown quantity at this time
    Join Date
    Dec 2010
    Posts
    33

    Language translation for TRIX indicator?

    Got it from .lua file, i know C# so i don't fully understand what it says, i try to build the indicator by my own from O2G ticks update-

    indicator.parameters:addStringAlternative("MA_2", "MVA", "", "MVA");
    indicator.parameters:addStringAlternative("MA_2", "EMA", "", "EMA");
    indicator.parameters:addStringAlternative("MA_2", "LWMA", "", "LWMA");
    indicator.parameters:addStringAlternative("MA_2", "TMA", "", "TMA");
    indicator.parameters:addStringAlternative("MA_2", "SMMA*", "", "SMMA");
    indicator.parameters:addStringAlternative("MA_2", "Vidya (1995)*", "", "VIDYA");
    indicator.parameters:addStringAlternative("MA_2", "Vidya (1992)*", "", "VIDYA92");
    indicator.parameters:addStringAlternative("MA_2", "Wilders*", "", "WMA");
    indicator.parameters:addString("MA_3", "Third Smoothing Method", "The methods marked by an asterisk (*) require the appropriate indicators to be loaded.", "EMA");
    indicator.parameters:addStringAlternative("MA_3", "MVA", "", "MVA");
    indicator.parameters:addStringAlternative("MA_3", "EMA", "", "EMA");
    indicator.parameters:addStringAlternative("MA_3", "LWMA", "", "LWMA");
    indicator.parameters:addStringAlternative("MA_3", "TMA", "", "TMA");
    indicator.parameters:addStringAlternative("MA_3", "SMMA*", "", "SMMA");
    indicator.parameters:addStringAlternative("MA_3", "Vidya (1995)*", "", "VIDYA");
    indicator.parameters:addStringAlternative("MA_3", "Vidya (1992)*", "", "VIDYA92");
    indicator.parameters:addStringAlternative("MA_3", "Wilders*", "", "WMA");
    indicator.parameters:addInteger("S_N", "Signal Periods", "", 9);
    indicator.parameters:addString("MA_S", "Signal Smoothing Method", "The methods marked by an asterisk (*) require the appropriate indicators to be loaded.", "MVA");
    indicator.parameters:addStringAlternative("MA_S", "MVA", "", "MVA");
    indicator.parameters:addStringAlternative("MA_S", "EMA", "", "EMA");
    indicator.parameters:addStringAlternative("MA_S", "LWMA", "", "LWMA");
    indicator.parameters:addStringAlternative("MA_S", "TMA", "", "TMA");
    indicator.parameters:addStringAlternative("MA_S", "SMMA*", "", "SMMA");
    indicator.parameters:addStringAlternative("MA_S", "Vidya (1995)*", "", "VIDYA");
    indicator.parameters:addStringAlternative("MA_S", "Vidya (1992)*", "", "VIDYA92");
    indicator.parameters:addStringAlternative("MA_S", "Wilders*", "", "WMA");

    indicator.parameters:addColor("TRIX_color", "Color of trix line", "", core.rgb(255, 0, 0));
    indicator.parameters:addColor("SIGNAL_color", "Color of signal line", "", core.rgb(0, 255, 0));
    end

    local source;
    local MA1, MA2, MA3, MA4;
    local TRIX, SIGNAL;

    function Prepare()
    local name;
    name = profile:id() .. "(" .. instance.source:name() .. "," .. instance.parameters.P_N .. "," .. instance.parameters.S_N .. ")";
    instance:name(name);

    MA1 = core.indicators:create(instance.parameters.MA_1, instance.source, instance.parameters.P_N);
    MA2 = core.indicators:create(instance.parameters.MA_2, MA1.DATA, instance.parameters.P_N);
    MA3 = core.indicators:create(instance.parameters.MA_3, MA2.DATA, instance.parameters.P_N);

    TRIX = instance:addStream("T", core.Line, name .. ".T", "T", instance.parameters.TRIX_color, MA3.DATA:first() + 1);
    TRIX:addLevel(0);

    MA4 = core.indicators:create(instance.parameters.MA_S, TRIX, instance.parameters.S_N);

    SIGNAL = instance:addStream("S", core.Line, name .. ".S", "S", instance.parameters.SIGNAL_color, MA4.DATA:first());
    end

    function Update(period, mode)
    MA1:update(mode);
    MA2:update(mode);
    MA3:update(mode);

    if period >= TRIX:first() then
    TRIX[period] = (MA3.DATA[period] - MA3.DATA[period - 1]) / MA3.DATA[period - 1] * 100;
    end
    MA4:update(mode);
    if period >= SIGNAL:first() then
    SIGNAL[period] = MA4.DATA[period];
    end
    end


    //------------------------


    Thanks.

  2. #2
    Natalya is offline Gold Member Natalya is an unknown quantity at this time
    Join Date
    Apr 2009
    Posts
    636
    Hi Block,

    It seems that my message has been deleted due to issues with the forum. So I'll post it again.

    You can use the indicorecom library. The library is intended to provide an access to standard and custom indicators of the Marketscope application. You can find the user guide in the Help folder with the folder where Order2Go API is installed. By default:
    C:\Program Files\Candleworks\FXOrder2Go\Help\indicorecom.chm

  3. #3
    Block is offline Gold Member Block is an unknown quantity at this time
    Join Date
    Dec 2010
    Posts
    33
    Hay Natalya...

    I saw the examples and i try to run it today, it was not work give 'indicators not loaded yet' exception maybe because it's Sunday despite i try to get list of the indicators, i will anyway try again later... i try to work with the examples from the extract (Sample 1-4) and one published in the site (MainApp and additional 3 .cs files), non of them work for me...

    Could you please direct me to C# simple code that only give me the list of available indicators and getting the rates of one of them in current time?

    Thank You.

  4. #4
    arindam89 is offline Bronze Member arindam89 is an unknown quantity at this time
    Join Date
    Oct 2011
    Posts
    12
    hi
    can u send me the link of trix.lau file (strategy)
    by

  5. #5
    Natalya is offline Gold Member Natalya is an unknown quantity at this time
    Join Date
    Apr 2009
    Posts
    636
    Please visit the FxCodeBase site. It is a great resource that offers hundreds of different indicators for the MarketScope charting package with Trix being one that's already been created and is ready to use. You can find it here:
    FXCodeBase.COM: Forex Chart Indicators and Development; View topic - Trix

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Disclaimer: Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice. Forex Capital Markets LLC. will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information.