Monthly Averaging with Conditions

Hi there,

I have a problem, I would like to program following.
I would like to save on the first of the month -monthly 500$ if certain conditions are true.
close > 10 and roc 3 > 0 or any other condtion
sell exit : timeexit or low is lower than for 2 years

I am sure this script is not correct but I tried
first mistake it buy only once and wait till the condition is true- my target it should buy every month so long the conditions are guilty. If the the time exit is true sell all or the the second condition is guilty.
What is here wrong and can someone help me.

// monthly amount 
FixedDollarAmount = 500;
PositionSize = FixedDollarAmount;
//every month firstday  
MonthBegin = Month() != Ref( Month(), -1 ); 
FirstPurchase = Cum( MonthBegin ) == 1; 

// monthly condition
Condition1 = C > 10;
Condition2 = ROC(3) > 0;
//Condition3 = H >= Ref(HHV(L,12),-1); 

// daily condition
TimeFrameSet( inDaily );  
//Condition4 = ROC(30) > 0;
TimeFrameRestore(); // restore time frame to original 

// SellCondtion
conditionexit = L <= Ref(LLV(L,24),-1);
// Entry 
Buy = IIf( MonthBegin AND Condition1 AND Condition2 , sigScaleIn, 0 ); // each month increase position if condition is guilty 

 //EXIT
 
//Sell = 0; // we do not sell 
Sell = ConditionExit;   // if condititon is guilty

//Timestop  /* N-bar stop *///
ApplyStop( stopTypeNBar, stopModeBars, 12 );