Simple Coding Help - No Promise.


Use this,and set number of bars from parameters.


Code:
TimeFrameSet( inDaily ); // switch now to daily
P1= Param("Daily P", 8, 3, 100,1);
mah_13D = MA( C, P1 ); // moving average from daily data
Plot( TimeFrameExpand( mah_13D, inDaily), " EMA Daily",ParamColor( "Daily EMA", colorCycle ), ParamStyle("Daily style",styleLine | styleThick| styleNoRescale));
TimeFrameRestore(); // restore time frame to original
Still facing the same issue, 5 mins chart showing different values than daily.
below have posted the screenshot of both

5 min chart (Small).jpg

Daily chart (Small).jpg
 

trash

Well-Known Member

Use this,and set number of bars from parameters.


Code:
TimeFrameSet( inDaily ); // switch now to daily
P1= Param("Daily P", 8, 3, 100,1);
mah_13D = MA( C, P1 ); // moving average from daily data
Plot( TimeFrameExpand( mah_13D, inDaily), " EMA Daily",ParamColor( "Daily EMA", colorCycle ), ParamStyle("Daily style",styleLine | styleThick| styleNoRescale));
TimeFrameRestore(); // restore time frame to original
You guys both have no clue at all.
TimeFrameExpand belongs to outside of TimeFrameSet..Restore

Also P1 is not an array but just a number so no need to put in TimeFrameSet. So in fact it can be placed anywhere.

Secondly you guys are both unable to read the description of each AFL function. If you do not add a third argument to TimeFrameExpand then default one expandLast gets applied!

What does expandLast mean and what other arguments are available?
If you don't know then simply read it up. https://www.amibroker.com/guide/afl/timeframeexpand.html


Other functions categorized https://www.amibroker.com/guide/a_catfunref.html Read them too before wondering about something and making up stories.



Code:
// P1 is not an array so can be placed anywhere
P1 = Param("Daily P", 8, 3, 100,1); 


TimeFrameSet( inDaily ); 
// switch now to daily 
mah_13D = MA( C, P1 ); // moving average from daily data 
TimeFrameRestore(); // restore time frame to original

mah_13D = TimeFrameExpand( mah_13D, inDaily, [b]expandFirst[/b] );


Plot( mah_13D, "EMA Daily", ParamColor( "Daily EMA", colorCycle ), ParamStyle("Daily style", styleLine | styleThick | styleNoRescale) ); 

if( Interval() == inDaily )
	Plot( MA(C, P1 ), "Daily MA without MTF", colorRed, styleDashed );

Plot( C, "Price", colorDefault, styleCandle );
 
What is the effect of SetForeign function on Buy/Sell/Short/Cover arrays.

For e.g. if I write AFL such as following

SetForeign("XYZ");
Buy = ...;
Short = ...;
Sell = ...;
Cover = ...;
RestorePriceArray();

Plot(C, "", colorBlack, styleCandle);
and then plot this AFL on symbol named ABC. Will the Buy/Sell orders go to ABC or to XYZ?
 
AB Manual again.




Hi Trash

I asked question about Buy/Sell/Short/Cover arrays not BuyPrice/SellPrice....

I did read the documentation on the function as well as thumbed thru few example codes but this aspect is not clear, at least not to me.
 

trash

Well-Known Member
Are you serious? If I'm showing you a picture visualizing MSFT signals with MSFT prices on AA ticker as done in previous post then obviously it means that it is MSFT signals but not AA ones.

Also the manual of setforeign shows a sample of buy sell signals within setforeign. Do you think it is shown out of fun?

Next question... do you think this animation is showing Santa Claus in string tanga or showing something different and quite obvious one? Watch carefully and look at title and signals text.

Are you looking for even more dumbed down examples that can be found out by actually trying code samples yourself?

 

Similar threads