NexusFi: Find Your Edge


Home Menu

 





crosses counter


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
 doitagaitforme 
Rostov-na-Donu/ Russia
 
Experience: Beginner
Platform: Metatrader
Posts: 17 since Jul 2010
Thanks Given: 8
Thanks Received: 4

Hi all. Advice please. I draw a horizontal line on the closing price and continue to the right. How can I count the number of intersections of this line with the future prices?


 
Code
ID = TL_New(Date, Time, Close, Date, Time, Close); Value1 = TL_SetExtRight (ID, True);


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
Memorandum Watch: How the 60-Day MOU Framework Makes May …
Prediction Markets & Event Contracts
Thursday May 28: GDP + Core PCE + Jobless Claims All at …
Traders Hideout
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
BERN ALGOS algo trading journal
8 thanks
  #3 (permalink)
 doitagaitforme 
Rostov-na-Donu/ Russia
 
Experience: Beginner
Platform: Metatrader
Posts: 17 since Jul 2010
Thanks Given: 8
Thanks Received: 4


The problem is solved. Thank onesmith on traderslaboratory
 
Code
input: count(3);
var: x(0), oldest(0), recycle(0), size(99);
array: id[99,3](0);  // 0=id, 1=price, 2=count, 3=age

once for x=0 to size begin
    id[x,0]=tl_new(d,t,0,d,t,0);
end;

if barstatus(1)=2 then begin
    oldest=0;
    for x=0 to size begin
        if L<=id[x,1] and H>=id[x,1] then begin
            id[x,2]=id[x,2]+1;
            if id[x,2]=count then begin
                id[x,1]=0;  id[x,2]=0;  id[x,3]=9999999;  tl_setend(id[x,0],d,t,0);  tl_setbegin(id[x,0],d,t,0);  // reset price, count and age
            end;
        end;
        if id[x,1]>0 then tl_setend(id[x,0],d,t,id[x,1]);
        id[x,3]=id[x,3]+1;
        if id[x,3]>oldest then begin
            oldest=id[x,3];  recycle=x;
        end;
    end;
    id[recycle,1]=c;  id[recycle,2]=0;  id[recycle,3]=0;  tl_setend(id[recycle,0],d,t,c);  tl_setbegin(id[recycle,0],d,t,c);
end;


Started this thread Reply With Quote
Thanked by:




Last Updated on April 27, 2012


© 2026 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 - Downloads - Top
no new posts