Good morning,
I have a little problem there.
I would like work with data from two different time interval. for example, BTC (1 day time interval) and BTC (4 hour time interval) chart.
The main time interval is the 4 hour. The value "HA_C", this is the close value of "BTC 1 Day". The "close BTC 1 Day time interval" value displayed correct in the 4 hour chart. But the value "test" with a simple arithmetic problem differs greatly and is wrong.
You can test this as follows: Loads the strategy in "BTC", time interval "1 Day", note from one day the "BTC Close" value and the "test" value.
Then switch to "BTC" 4 hour time interval. You will see, that the "HA_C Close" from the 1 hour time interval is the correct value, but the "test" value is displayed incorrectly.
Why is the "test" value after a calculation incorrectly, although the "Close" value is correct ???
I have find out, that the problem is the "ta.ema (source, length)" function. Can someone give me a formula, that calculates the same value as the "ta.ema (source, length)" function.
**// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © flashpit
//@version=5
strategy("TEST", process_orders_on_close=true, overlay=true, calc_on_every_tick=true, pyramiding=30)
varip test = 0.0
HA_Symbol = ticker.heikinashi("BINANCE:BTCUSDT")
HA_C = request.security(HA_Symbol, "1D", close)
test:= ta.ema(HA_C, 7) * 1.05
plot (HA_C)
plot (test)**
