Is it possible to Link AFL's in Amibroker?

#1
Hi,

Does anyone know if it is possible to link/ refer different AFL's in Amibroker. Just like in Excel, we can refer a different sheet.

For e.g., suppose we have Heikin Ashi in one Pane and RSI in second pane. Is it possible that when Heikin Ashi gives a Buy signal, the RSI Value at that point gets displayed on the second pane?

Rythm
 

casoni

Well-Known Member
#2
Hi,

Does anyone know if it is possible to link/ refer different AFL's in Amibroker. Just like in Excel, we can refer a different sheet.

For e.g., suppose we have Heikin Ashi in one Pane and RSI in second pane. Is it possible that when Heikin Ashi gives a Buy signal, the RSI Value at that point gets displayed on the second pane?

Rythm
Hello ,
yes it is possible .

example
//Panel 1
indicator = CCI();
Buy= Cross(indicator, 0);
StaticVarSet("signals", Buy);
Color = IIf(Buy, colorBlue, colorLightGrey);
Plot(indicator, "CCI", Color,2);
PlotGrid(0, colorRed);
PlotShapes(Buy*shapeUpArrow,colorBlue,0,0,0);

//Pane 2:
sig = StaticVarGet("signals");
Color = IIf(sig, colorGreen, colorLightGrey);
Plot(C, "price", Color, styleBar);
PlotShapes(sig*shapeUpArrow,colorBlue,0,L,0);

Hope this is what you were looking for.
Thank you
 

bharatk8

Active Member
#4
Hi
I have one code (for transmitting buy sell signals to bracket trader) which has Static VarGet functions similar to code presented on this thread/post.But when I copy pasted it in my AFL it flashed syntax errors.......Pl. see the code and correct it.

if ( BuyTrigger AND OrderType == "LMT" AND OrderLock )
{
if ( ( StaticVarGetText( "Bracket" + Name() ) == "ON" AND TradeGet == 1 ) OR StaticVarGetText( "Bracket" + Name() ) == "OFF" )
{
BuyOrderID = ibc.PlaceOrder( Name(), "Buy", Units, "LMT", BS, 0, OrderTime, False, 1 );
Say( "Buy at Limit", 1 );
_TRACE( "#BUY at LMT - " + Name() );
StaticVarSetText ( "OrderNumber" + Name(), BuyOrderID );

PersistentVarSetText( Name() + "LastOrder" , "Long" );
PersistentVarSetText( Name() + "BuyOrderID" , BuyOrderID );
PersistentVarSet( Name() + "BuyOrderPRICE", BS );
PersistentVarSet( Name() + "Units" , Units );
PersistentVarSetText( Name() + "CurrentOrderType" , "LMT" );
}

if ( ( StaticVarGetText( "Bracket" + Name() ) == "ON" AND TradeGet == 1 ) OR ( StaticVarGetText( "Bracket" + Name() ) == "OFF" AND TA > 0 ) )
{
LimitOrderID = ibc.PlaceOrder( Name(), "Sell", Units, "LMT", TA, 0, "GTC", False, 1, "", BuyOrderID );
PersistentVarSetText( Name() + "LimitOrderID", LimitOrderID );
PersistentVarSet( Name() + "LimitOrderPRICE", TA );
}

if ( ( StaticVarGetText( "Bracket" + Name() ) == "ON" AND TradeGet == 1 ) OR ( StaticVarGetText( "Bracket" + Name() ) == "OFF" AND ST > 0 ) )
{
StopOrderID = ibc.PlaceOrder( Name(), "Sell", Units, "STP", ST, ST, "GTC", Transmit, 1, "", BuyOrderID );
PersistentVarSetText( Name() + "StopOrderID", StopOrderID );
PersistentVarSet( Name() + "StopOrderPRICE", ST );
}
}




Hello ,
yes it is possible .

example
//Panel 1
indicator = CCI();
Buy= Cross(indicator, 0);
StaticVarSet("signals", Buy);
Color = IIf(Buy, colorBlue, colorLightGrey);
Plot(indicator, "CCI", Color,2);
PlotGrid(0, colorRed);
PlotShapes(Buy*shapeUpArrow,colorBlue,0,0,0);

//Pane 2:
sig = StaticVarGet("signals");
Color = IIf(sig, colorGreen, colorLightGrey);
Plot(C, "price", Color, styleBar);
PlotShapes(sig*shapeUpArrow,colorBlue,0,L,0);

Hope this is what you were looking for.
Thank you
 

Similar threads