Want to explore golden cross

I am looking to scan golden crosses in my database periodically or in a date range.

Expected result:
Should show recent golden crosses with below characteristics.

  1. Recent golden cross.
  2. Close is higher then open.
  3. Close above 50.
  4. Volume MA(10) IS greater than 300000.

Getting wacky results, i am making some fundamental mistakes, but do not know what.

Mahesh

// Stocks hitting golden cross
MA_Short = MA(C, 50);
MA_Long = MA(C, 200);

// Filter conditions
FC1 = Cross(Ref(MA_Short,-1),Ref(MA_Long,-1));
FC2 = Ref(C,-1) > Ref(O,-1);
FC3 = C > 50;
FC4 = MA( V, 10 ) > 300000;


// Filter = FC1 AND FC2 AND FC3 AND FC4;
Filter = FC1;
// Columns
AddColumn( C, "Close" );
AddColumn( MA_Short, "50 MA" );
AddColumn( MA_Long, "200 MA" );


Might be an idea to explain better what you mean by "wacky" and give some examples. This code does not do anything other than show some colums and do some calculations that don't end up anywhere.

1 Like

@Henri you are right there is no problem with the code only my understanding. Thanks for responding. please consider this query resolved.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.