NexusFi: Find Your Edge


Home Menu

 





How to detect condition in the last few current minutes?


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,604 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread

How to detect condition in the last few current minutes?

  #1 (permalink)
Artfldgr
New York + New York / USA
 
Posts: 76 since Jan 2020
Thanks Given: 2
Thanks Received: 90

This has been driving me nuts for a short while...
[and i am a professional programmer of more common languages like Java]

Its really a general question about how to only detect a condition, like crossover within the last few minutes, and ignore crossovers that occurred earlier in the time period.

To make this clear... lets say your looking at a 1 min chart, and its the afternoon..
and your running a plot like this

def ema1 = ExpAverage(close, 8);
def ema2 = ExpAverage(close, 88);
def emaCrossingAbove = ema1[1] < ema2[1] and ema1 > ema2;
plot aaa = ema1;
plot bbb = ema2;
plot scan = emaCrossingAbove;
scan.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

And it works ok... it detects the crossover above, and indicates with an arrow
and you can use it in a scan (of course)

however, and here is the real dig... you dont care if there were three crossovers in the morning
you only want to know if one has occurred within the past 5 minutes (or some period of time) from current moment

similarly... you have two averages.
def ema1 = ExpAverage(close, 8);
def ema2 = ExpAverage(close, 88);

and you want to indicate with an arrow if their distance apart is a certain amount
call it an almost cross over...
and of course, like above, you dont care if they almost crossed over (to the dark side?) earlier in time

These two things been driving me nuts to implement..
as the 2nd one can help detect a widening average, or converging average..

however the question of event in time or past x time, can help a whole lot in a lot of ways...

any takers?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
Exit Strategy
NinjaTrader
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
DaveDoggyDogg
Los Angeles,CA USA
 
Posts: 16 since Mar 2017
Thanks Given: 0
Thanks Received: 7


Artfldgr View Post
This has been driving me nuts for a short while...
[and i am a professional programmer of more common languages like Java]

Its really a general question about how to only detect a condition, like crossover within the last few minutes, and ignore crossovers that occurred earlier in the time period.

To make this clear... lets say your looking at a 1 min chart, and its the afternoon..
and your running a plot like this

def ema1 = ExpAverage(close, 8);
def ema2 = ExpAverage(close, 88);
def emaCrossingAbove = ema1[1] < ema2[1] and ema1 > ema2;
plot aaa = ema1;
plot bbb = ema2;
plot scan = emaCrossingAbove;
scan.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

And it works ok... it detects the crossover above, and indicates with an arrow
and you can use it in a scan (of course)

however, and here is the real dig... you dont care if there were three crossovers in the morning
you only want to know if one has occurred within the past 5 minutes (or some period of time) from current moment

similarly... you have two averages.
def ema1 = ExpAverage(close, 8);
def ema2 = ExpAverage(close, 88);

and you want to indicate with an arrow if their distance apart is a certain amount
call it an almost cross over...
and of course, like above, you dont care if they almost crossed over (to the dark side?) earlier in time

These two things been driving me nuts to implement..
as the 2nd one can help detect a widening average, or converging average..

however the question of event in time or past x time, can help a whole lot in a lot of ways...

any takers?


the following code is defining the last 10 bars, and since its set to 1 Minute, 1x10=10

therefor the scan will scan the last 10 minutes of 1 minute bars for crossings of the 8ma over the 88

 
Code
MovAvgExponential("length" = 8)."AvgExp" crosses above MovAvgExponential("length" = 88)."AvgExp" within 10 bars

Reply With Quote




Last Updated on March 5, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts