You should be using expand* constants without adding or subtracting anything. There are 3 possibilities: expandFirst, expandLast and expandPoint. These constants have numerical values that can be checked using for example this:
and they are 1, 0, 2. (expandLast - 1) would resolve to -1 which is NOT officially supported value, but since internal logic uses "fail-safe" behavior any value other than expandFirst and expandLast is treated as expandPoint, so your code should just useexpandPoint.
TimeFrameGetPrice( pricefield, interval, shift = 0, mode = expandFirst )
What is default value/setting for mode if it is not set ?
Wil it be expandFirst ?
@tgbssk, when you examine the functions documentation, you can clearly distinguish the OPTIONAL parameters (i.e., the ones you can omit) and the DEFAULT values that are used in the function call when you do not specify them.
These are the ones that have an equal sign = followed by a value (the default).