No i am just make sure you understand how the function work , no more no less
i already a write a snippet code for you to work on it , to make some modification , and to see how you can export the result to analysis window because the main goal you declared in the first post was to learn , remember ? 
Anyway , here is a complete code to show bullish and bearish stocks according to your conditions , but you need to study all functions within the code to understand how it works as well as the links provided previously
// Assigning some Variables ...
MA50 = MA(C,50);
AR = ATR(22);
// Buy and Short Condtion ...
BC = Buy_Condition = Cross(C,MA50) and MACD(6,18) >= Signal (6,18,9);
SC = Short_Condition = Cross(MA50,C) and MACD(6,18) <= Signal (6,18,9);
// Entry Price ...
EPBC = Bullish_Entry_Price = ValueWhen(BC,C);
EPSC = Bearish_Entry_Price = ValueWhen(SC,C);
// Buy and Short Targets ...
FTBC = First_Target_BC = EPBC + AR*3 ;
STBC = Second_Target_BC = EPBC + AR*6 ;
FTSC = First_Target_SC = EPSC - AR*3 ;
STSC = Second_Target_SC = EPSC - AR*6 ;
// Exporting Results to Analysis Window ...
Filter = BC OR SC;
AddColumn(EPBC,"Entry Price as a Bull",1.2,colorDefault,colorLime);
AddColumn(FTBC,"First Target as a Bull",1.2,colorDefault,colorOrange);
AddColumn(STBC,"Second Target as a Bull",1.2,colorDefault,colorOrange);
AddColumn(EPSC,"Entry Price as a Bear",1.2,colorDefault,colorRed);
AddColumn(FTSC,"First Target as a Bear",1.2,colorDefault,colorGold);
AddColumn(STSC,"Second Target as a Bear",1.2,colorDefault,colorGold);
You are the one supposed to tell us , its your code now 