100011 2 posts msg #158999 - Ignore 100011 | 
4/24/2022 9:09:17 PM
  Hi Everyone,
 
 I've came across some code (sorry don't remember who to give credit) and added a few basic updates. The one issue I'm trying to figure out is how to sort it by days since one of the triggers triggered. I would be nice to see in order of when Longposition or Shortposition triggered. Instead of going through the charts. 
 
 Thanks in advanced!
 
 
 sp500
 
 set{E3, ema(10) - ema(50)} 
 
 set{Longposition, count(E3 > 0,1)} 
 set{Shortposition, count(E3 < 0,1)} 
 SET{TRIGGER,0} 
 
 draw shortposition on plot trigger 
 draw longposition on plot trigger
 
 add column ema(10) 
 add column ema(50) 
 add column longposition
 add column shortposition 
 
 
 draw ema(10) 
 draw ema(50) 
 draw ma(200)
 
 chart-time 1 year
 
 
 
 
  |