lowest low with condition based on moving average
Forums › ProRealTime English forum › ProOrder support › lowest low with condition based on moving average
- This topic has 8 replies, 3 voices, and was last updated 4 years ago by AE.
-
-
12/15/2019 at 6:01 PM #11493312/15/2019 at 6:26 PM #11493512/15/2019 at 6:33 PM #11493612/15/2019 at 7:42 PM #11493812/15/2019 at 8:36 PM #11494112/16/2019 at 9:16 AM #114950
The below code is computing the lowest low when MA100 is under the MA200 and reset that value each time the MA100 crosses under the MA200.
1234567891011ma100=average[100]ma200=average[200]if ma100 crosses under ma200 thenll=ma200endifif ma100<ma200 thenll=min(ll,low)endifreturn ma100,ma200,ll1 user thanked author for this post.
12/16/2019 at 9:19 AM #114952This indicator will show each new low after MA100 has crossed below MA200 and price is below MA200. It draws an arrow each time a new low is found and draws a line at the last lowest value found. It resets every time price goes back above MA200.
It is an indicator but should give you some idea how to achieve what you want in a strategy. (I’m a little confused by exactly what you want!)
1234567891011121314151617181920if average[100] crosses under average[200] thenflag = 1endifif average[100] crosses over average[200] thenflag = 0endifif average[100] < average[200] and average[100](close[1]) > average[200](close[1]) thenmylow = lowendifif flag and close < average[200] thenmylow = min(low,mylow)if low = mylow thendrawarrowup(barindex,low) coloured(128,0,0)endifendifreturn mylow1 user thanked author for this post.
12/16/2019 at 9:43 AM #114955Thanks both,
Maybe I confuse you because I didn’t explain very well.
I´m triying to do backtest of COMA strategy: https://medium.com/@rcanessa/estrategia-de-trading-coma-para-mercados-en-tendencia-df74b8dd87a5
https://www.youtube.com/watch?v=BFXp7OLfDtM&t=2s
It’s in spanish but if you need I can translate it.
Do you know this strategy?
12/16/2019 at 10:08 AM #114956Ok, I just make it with the idea of both
1234567891011121314ma100=average[100]ma200=average[200]if ma100 crosses under ma200 thenmylow = 9999999999endifif ma100 > ma200 and low < ma200 thenmylow = min(low,mylow)if low = mylow thendrawarrowup(barindex,low) coloured(128,0,0)endifendifreturn mylowThanks you guys!
-
AuthorPosts
Find exclusive trading pro-tools on