NexusFi: Find Your Edge


Home Menu

 





question: do something IF current bar (or previous bar) is LLV


Discussion in Platforms and Indicators

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




 
Search this Thread

question: do something IF current bar (or previous bar) is LLV

  #1 (permalink)
choubix
Bangkok + Thailand
 
Posts: 10 since Aug 2012
Thanks Given: 2
Thanks Received: 0

Hi,

I would like to calculate the ratio between MinL and MaxH only if MinL is the current bar (or the one before).

MinL and MaxH are defined as follows.

MaxH = HHV(Mom, Len);
MinL = LLV(Mom, Len);

Mom is a lengthy formula defining momentum and Len = 5 bars

I tried IIF and If statements with the following syntax to compare but I cannot get it to work.

Would anybody have an idea on how to do that please?

Thanks a bunch

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
19 thanks
GFIs1 1 DAX trade per day journal
16 thanks
Spoo-nalysis ES e-mini futures S&P 500
15 thanks
  #2 (permalink)
bob303
paris France
 
Posts: 5 since Mar 2014
Thanks Given: 1
Thanks Received: 1

Hi,
try this :

Mom = ROC(C,1) ;
Len = 5;

MaxH = HHV(Mom, Len);
MinL = LLV(Mom, Len);

ratio_MaxMin = IIf( (mom == Minl) OR (Ref(mom,-1) == Minl) , 100* ( MaxH / MinL ),0);

Plot( ratio_MaxMin, "ratio_MaxMin", colorBlue, styleLine|styleThick);

Reply With Quote




Last Updated on April 9, 2015


© 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