Asking about using the expandlast function

Hi all

I tried to make multiple timeframe chart which is 1tick and 10ticks.
and in order to make it, I use the expand last function such as below coding

As you know, the 10ticks will be created after collecting the smaller ticks.
But, when I saw the chart through the exploration, the MHigh which is the highest price in 10ticks chart was shown at 10th bar in 1tick chart.

In other words, the starting point or time is different and I attached to explain what I want to ask.

Lastly, I saw some code which is "expandlast + 1" <- what is the meaning of this "+1" here?

please let me know if you know these two questions...

_SECTION_BEGIN("Question");
SetChartOptions(0,chartShowArrows|chartShowDates);

//Plot CandleSticks
//Plot(C, "Price", ParamColor( "Color", colorDefault), ParamStyle( "Style", styleCandle, maskPrice ) );
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

// Contract specifications
TickSize = 0.25;
PointValue = 50;
RoundLotSize = 0;
PositionSize = MarginDeposit = 1;

SetOption( "FuturesMode", True );

Majorintervalstandard = 10;
Majorinterval = -Majorintervalstandard;
TimeFrameSet(Majorinterval); // switch to 5 tick interval
MHigh = High;
TimeFrameRestore();

MHigh = TimeFrameExpand(MHigh,Majorinterval,expandLast);

AddColumn(High,"High");
AddColumn(MHigh,"MHigh");

Filter = 1;

//Money Management

SetPositionSize( 1, spsValue ) ; // 1 Lakh in each Trade

//TRADE DELAYS
SetTradeDelays(0,0,0,0);

_SECTION_END();

QQ

In other word, I want to move the highest price which was created before in the red box to the blue box.

So someone send you PM with incorrect conclusion?
The edit of the picture is incorrect. It would not shift by one to the right.

expandLast+1 simply is expandFirst! That's all. So it would do the same as just inserting expandFirst.

printf("expandLast: %g, expandFirst: %g, expandPoint: %g", 
		expandLast, expandFirst, expandPoint);

17

@fxshrat, just single letter a.

Thank you fxshrat for the reply
so you mean that it is impossible to shift by one to the right ??

No, where did I write that? I commented on expandLast+1. Nothing more and nothing less.

If you want to shift expanded array to the right at selected interval then use Ref() function.

var = TimeFrameExpand(var, from_interval, expandLast);
var = Ref(var,-1);

I'm so sorry for fixing your picture, I just want to explain how I want to explain what I want to make.

I'm really apologised about fixing your picture one more time and I delete the above reply not to make it confused

And Thank you so much your reply

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.