NexusFi: Find Your Edge


Home Menu

 





Bar calc from opening


Discussion in ThinkOrSwim

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




 
Search this Thread

Bar calc from opening

  #1 (permalink)
 metotron 
moscow
 
Experience: Intermediate
Platform: AmiBroker
Posts: 4 since Feb 2010
Thanks Given: 2
Thanks Received: 0

Hi,
I've created the indicator to show how many bars close was > MA
But the problem is I don't know how to start my calculation at 9:30. I see some bars that cross the MA yesterday and I get on my first intraday some value. But I want to have 1 if first bar close is > MA regardless yesterday's bars
Could you help to update it

input length = 12;
input price = close;
def BarsPerDay = 78;

def ma = MovingAverage(AverageType.SIMPLE, price, length);
plot UpBars = fold hh = 1 to BarsPerDay while close[hh] > ma[hh] do hh;

Started this thread Reply With Quote




Last Updated on April 5, 2016


© 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