New to Ninjascript and was wondering if I can enlist some help as I build my strategy =)
I am trying to set up a variable that updates when MACD histogram rebounds from the lowest lows (conversely retraces from highest high).
My question is this:
1. Can we set the boundaries of user defined variables? (I would need two variables, one with min -1, max 0, the other with min 0, max 1)
2. What would be the east way to retrieve MACD histogram bar value for the most recent bar update? I'm having a hard time getting the model to return the last MACD bar value.
3. I want the model to always have a position in the market (either always long or always short), thus is there a simple command that would reverse the long position and turn it into short and vice versa?
many thanks....
Comment