Multi-time-Frame Indicators with Multicharts?

Discussion in 'Automated Trading' started by yosuji198, Apr 3, 2023.

  1. MarkBrown

    MarkBrown

    so here is mc with data 1 - 1 min and data 2 - 3 min

    there are 2 macd's one is placed on data1 and the other is on data 2

    i hope this helps maybe. under properties you can specify what data series that indicator is to be applied to.

    ps - the indicators will all automatically default to data 1 unless you specify differently in properties.

    [​IMG]
     
    #11     Apr 3, 2023
  2. mervyn

    mervyn

    idk, i have 2 charts 2 timeframes and 2 macds in a same window, without coding.
     
    #12     Apr 4, 2023
  3. yosuji198

    yosuji198

    I misspoke - I haven't figured it out. My 3 minute numbers are wrong. I can confirm that the MACD and Signal numbers (in the GPT - MACD columns below) are correct. But the Macd 3 min and Signal 3 min numbers are wrong. The correct numbers for the 3 minute are in the below (GPT MTF) section. What's happening here? Is it something wrong with the code I posted on here yesterday? Or do I have to do something with the charts? I already have the 3 minute chart loaded in Data 2 :banghead:
    upload_2023-4-4_19-8-48.png
     
    #13     Apr 4, 2023
  4. yosuji198

    yosuji198

    Ok! I finally figured it out!. The correct code is as below. Thanks everyone for trying!

    Inputs: FastLength(12), SlowLength(26), SignalLength(9);

    Variables: FastMA(0), SlowMA(0), MACD(0), Signal(0), MACD_3(0), Signal_3(0), FastMA_3(0), SlowMA_3(0);


    FastMA = XAverage(Close, FastLength);
    SlowMA = XAverage(Close, SlowLength);
    MACD = FastMA - SlowMA;
    Signal = XAverage(MACD, SignalLength);

    FastMA_3 = XAverage(Close, FastLength)data2;
    SlowMA_3 = XAverage(Close, SlowLength) data2;
    MACD_3 = FastMA_3 - SlowMA_3;
    Signal_3 = XAverage(MACD_3, SignalLength)data2;
     
    #14     Apr 4, 2023
    Rnstwy and MarkBrown like this.