a = histoprice(_open,0) < histoprice(_close,1);
b = day() != ref(day(), 1);
c = a and b;
d = sum(c, 8*10); // Number of past bars to look: In a hourly chart, there are 8 bars in a day
i came across an indicator that you guys created. YTimeSum(rule, 16,00);
this works and gives me the number of times the cross over occurred before 4pm. only problem is that when I create a pane to display this... i would expect the value to increase for everytime the cross over occured... but it does not. it stays constant to zero but right after 4pm.. it says "6" which is actually the total numbers of times cross over occured. anyway to make it add each time through out the day?
This function returns the sum of the specified time series for every value that occurred before the specified time.
To get the total number of crossover, you can use "sum" function.
QS, I agree with you but the sum function gets the total number of crossover for the # of bars that you tell it. As time moves forward.. so does the range that you give the sum function.
for ex:
a= t1= 1, t2=2, t3=3
sum(a,2); solution at t2= 3, but solution at t3=5.
What I want to see is:
1, 3, 6
The YTimesum works..but it doesn't plot on pane properly.. and nor does it work in a filter.
Again, i'm trying to find the # of times a crossover occurs for ONE day (9:30-4pm) as they occur. So if before 10am the cross over occurred 10 times.. and then from 10am to 11am the crossover occurred 2 additional time.. at 11AM the value should be 12, and so on.
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.