Author Topic: Translating SSE to PRIMUS  (Read 6305 times)

Bobby

  • Newbie
  • *
  • Posts: 4
    • View Profile
Translating SSE to PRIMUS
« on: January 04, 2017, 02:30:09 pm »
Hi, can you help me translate my formula from SSE to PRIMUS? I cannot figure out what the issue is. I can do the 'Tap' and 'Tap Filter' part.

SSE:
(Last %Change Close) > @SPY.PctChg and  i5Last>=(i5MAP20(1)+((i5StdDev20(1)*3)*1.25)) and Abs(Last - i5Close(3)) > .5*ADR20

PRIMUS I have:
(( Last(ALL_VENUES, CURRENT, NO) - ClosePrice(PRIMARY, CURRENT, NO)) / ClosePrice(PRIMARY, CURRENT, NO)) > (( IndexLast('.SPX', CURRENT, NO) - IndexClosePrice('.SPX', P1)) / IndexClosePrice('.SPX', P1)) AND ( Last(ALL_VENUES, CURRENT, NO) > ( BollingerBands(CURRENT, MINUTES_5, 20, ALL_VENUES, NO, UpperBand, V3) *1.25) AND (( MinuteOpen_I(ALL_VENUES, 5, P3, NO) - Last(ALL_VENUES, CURRENT, NO)) > ATRStock(ALL_VENUES, NO, DAILY, 20, CURRENT) * .5

But PRIMUS outputs no symbols while SSE does. Same issue on Long side.

wmariconti

  • Global Moderator
  • Newbie
  • *****
  • Posts: 9
    • View Profile
Re: Translating SSE to PRIMUS
« Reply #1 on: January 05, 2017, 11:45:51 am »
Here are  a couple of observations. I am going to test this in Primus and then give a more definite answer.

( BollingerBands(CURRENT, MINUTES_5, 20, ALL_VENUES, NO, UpperBand, V3) *1.25)

I assume that you want 3 *1.25 =3.75 StdDevs
Putting the 1.25 outside of the (  ) will not work. It is scaling the overall Band value not just the Std.
I don't think that that the syntax supports putting it inside the (  ) eiether.

 BollingerBands(CURRENT, MINUTES_5, 20, ALL_VENUES, NO, UpperBand, V3 * 1.25)

What we really need is a separate expression for StandardDeviation. Then we could write it like we did originally.

( MinuteOpen_I(ALL_VENUES, 5, P3, NO) - Last(ALL_VENUES, CURRENT, NO)
 (Last(ALL_VENUES, CURRENT, NO) - MinuteOpen_I(ALL_VENUES, 5, P3, NO) )
shouldn't this be reversed


Bobby

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Translating SSE to PRIMUS
« Reply #2 on: January 05, 2017, 12:20:30 pm »
Awesome Warren thank you. Will put into practice today

wmariconti

  • Global Moderator
  • Newbie
  • *****
  • Posts: 9
    • View Profile
Re: Translating SSE to PRIMUS
« Reply #3 on: January 05, 2017, 03:52:05 pm »
For now stick to
BollingerBands(CURRENT, MINUTES_5, 20, ALL_VENUES, NO, LowerBand, V3)

I will check into getting V3_5 and V_4 added to the system.
Even better a StandardDeviation function which we can multiply by any number.

Dunneback

  • Guest
Re: Translating SSE to PRIMUS
« Reply #4 on: April 27, 2018, 06:28:37 am »
Did you get on that, wmariconti? StandardDeviation function would be a neat feature to have for sure.