- ago
I have an programming question
first of all this strategy is meant for calculating all prices from the beginning but just on the last close prices;
in WL6 I had :
CODE:
int bar_begin = Bars.Count - 3; int bar_einde = Bars.Count - 150; for ( int bar1 = bar_begin; bar1 >= bar_einde; bar1-- ) bar-- // from the end going backwards

but I found in WL7 [idx] cannot changed to idx-- or --idx. or backwards
so the question is how I do I rewrite WL6 into the WL7 code?
---
i am establishing the highest high from the last peak; as defined by two consecutive lower highs. im am interested in the beginning but only the last. when found it is more or less the resistance priceline
--
@Eugene
correctly understood, the loop is meant to identify the high/low for support and resistence. On the intraday the action buy/sell is considered when piercing through the identified s/r lines but these s/r are not the only triggers for my b/s action.
But my question was how do I loop back? idx-- (or --idx) does not work
@Eugene
I got it :), no furher action needed. (I need to get used to wl7 C#
please close this post
0
602
4 Replies

Reply

Bookmark

Sort
- ago
#1
Forget about this code for now. A word for word translation may be suboptimal. If you could expand on the price calculation we'd suggest an efficient way. In other words, tell us about your objective.
0
- ago
#2
i am establishing the highest high from the last peak; as defined by two consecutive lower highs. im am interested in the beginning but only the last. when found it is more or less the resistance priceline
0
- ago
#3
I see. Sounds like you'll be pleasantly surprised after looking at the QuickRef samples for PeakTroughCalculator. Easy detection of falling/rising peaks and troughs as well as accessing Trendlines is what it's about. Check it out first before anything else.
0
Glitch8
 ( 12.05% )
- ago
#4
You could also just run your own loop backward through the data in the Initialize method, nothing's stopping you from doing that. But you won't be able to place trades in that loop, it'd be just for data crunching or analysis.
0

Reply

Bookmark

Sort