Simple Coding Help - No Promise.

travi

Well-Known Member
Hi

if ( NewPeriod )
{
GfxSelectSolidBrush( colorYellow );
GfxSelectPen( colorYellow, 2 );
Say( "hi its a New period" );
}
This is the code that gives me alert whenever new period occurs
but if i apply the same syntax for golden cross alert, afl shows error


goldencross= Cross(MA1, MA2); //moving average bullish
if ( goldencross )
{

Say( "hi its a goldencross" );
}

Can anyone please help me on this. Thanks
What do u mean by "NewPeriod"?
the condition isn't clear.
 

john302928

Well-Known Member
What do u mean by "NewPeriod"?
the condition isn't clear.
New period is one of the criteria with some conditions which is defined in the part of the code which is not shown to avoid lengthy codes.
 
Last edited:
Hello
Is it possible to add an average 50 (TriangularMA)
To the index Accumulation Swing Index
With explor OR SCAN (BUY-SELL)
If the Indicator (ASI) breached average (TriangularMA 50)
Or breakage
thank you


AFL

_SECTION_BEGIN("asi+ma50");
function SwingIndex( Limit )
{
Hy = Ref( H, -1 );
Cy = Ref( C, -1 );
Ly = Ref( L, -1 );
Oy = Ref( O, -1 );

r1 = abs( H - Cy );
r2 = abs( L - Cy );
r3 = abs( H - L );
r4 = abs( Cy - Oy );

k = Max( r1, r2 );

r = IIf( r1 >= Max( r2, r3 ), r1 - r2 / 2 + r4 / 4,
IIf( r2 >= Max( r1, r3 ), r2 - r1 / 2 + r4 / 4,
r3 + r4 / 4 ) );

return IIf( r == 0, 0, 50 * ( ( C - Cy + 0.5 * ( C - O ) + 0.25 * ( Cy - Oy ) ) / r ) * k / Limit );
}

function AccumulationSwingIndex( Limit )
{
return Cum( SwingIndex( Limit ) );
}

index = AccumulationSwingIndex( Param( "Limit", 100, 1, 1000 ) );
Plot( index, _DEFAULT_NAME(), ParamColor( "Color", colorRed ) );
Plot( MA( index, 50), "MA-50", colorWhite );
_SECTION_END();




remind
Thank
 

john302928

Well-Known Member
hi tradertrader, there is one rsi divergence afl posted in marketcalls webpage. please check it out and let me know if that is what you want
 

HappyLife

Well-Known Member
It's time to finally purchase AB (if you use it). No excuses anymore.
@trash thanks for quick help

while coding the Holy Grail :rofl: ….. not ask for help but ask on this silly one:mad:
thought their may be a command for this in 5.6 but after identifying my silliness:D …… use function command & make it work in the way I want it:clapping:.

one more Holy Grail needed ……. 2 diff Timeframes Candlestick in one without not too much looping.
 
Last edited:

checkmate7

Well-Known Member
Anybody who is using Elliot Wave and have its AFL???
 

john302928

Well-Known Member

chintan786

Well-Known Member
Dear Happy Singh Ji,
Hope you are doing Good.

I am looking for afl, which can plot Hrly Poc on candles.
Do let me know if it is possible.

Best Regards,
 

Similar threads