Hello,
Would like to know if "<<" can be used to stop the signal for given bar numbers.
Example,
CODE:
Please log in to see this code.
similar to
CODE:
Please log in to see this code.
The trigger will not be in real time, but when it does trigger after certain time, the trend has already begun.
What will be the value of highB[bar] at given time. Would it be "0" or "1" or undefined.
Thanks,
Sofia
Size:
Color:
QUOTE:
Would like to know if "<<" can be used to stop the signal for given bar numbers.
I don't see any connection between stopping some signal and making future data available on past bars by shifting the DataSeries back. Let's rephrase the question: what do you mean by
"stop the signal for given bar numbers", precisely? Chances are, something else might do rather than the offset operators.
QUOTE:
What will be the value of highB[bar] at given time. Would it be "0" or "1" or undefined.
Check it out for yourself with
PrintDebug.
Size:
Color:
I want to mask my dataseries with binary pattern series,
CODE:
Please log in to see this code.
I thought, using "<<" operator would do, but "<<" is not a correct method, because we cannot process data that does not exist.
Is there any other way to generate a binary series?
Thanks.
Size:
Color:
Both ! and && operators apply to boolean values, and DataSeries contain double values. Could you tell me rather what are you trying to accomplish with this, illustrating it with real example code? Like I said above, if you show where and how you need to "stop the signal for given bar numbers", we might suggest a working design pattern for that.
Size:
Color:
Ok, here is an example .
CODE:
Please log in to see this code.
Thanks,
Sofia
Size:
Color:
OK, since there seems to be a disconnect between us let's rephrase. I'm not proposing to help you build any "binary series". It makes no sense to me. What I'm trying to do is to understand the purpose of its application to your real task. What your task is in plain English, precisely, without referring to any "binary series" or shift operators? What kind of trade signal are you trying to stop for given bar numbers? Please clarify this.
Size:
Color:
Sorry for the confusion. I want to use the signal in the future using "<<" shift .
Would like to know if this.
CODE:
Please log in to see this code.
is same as
CODE:
Please log in to see this code.
I am trying to code following condition.
CODE:
Please log in to see this code.
Thanks,
Sofia
Size:
Color:
QUOTE:
I want to use the signal in the future using "<<" shift .
Would like to know if this.
is same as
You're right, these are different styles of building the same DataSeries.
Size:
Color:
Sophia (and anyone else reading this), you do know that shifting data to the left (from the future to the past) using the << operator is peeking, right?
The only valid shift is to take data in the past and shift it to the right using the >> operation.
Size:
Color:
Hello Another question regarding shift Operator.
Is this
CODE:
Please log in to see this code.
same as
CODE:
Please log in to see this code.
Thanks,
Sofia
Size:
Color:
Of course they are not. And you can make sure of that by plotting them, aren't you?
In the 1st fragment, you shift the series on 30-minute scale. On the 2nd, the compressed series are being shifed one bar forward on the chart's native scale (which can be as small as 1-minute).
Size:
Color:
Hello,
Another question regarding shift signal to left i.e shift using " << " operator.
Is it possible to capture data into separate dataseries for future use at that particular instance whatever the value is.
It might change in the future because of peeking, but is it possible to save the instantaneous value.
CODE:
Please log in to see this code.
Does the dataseries "datap" store the instantaneous values ?
Thanks,
Sofia
Size:
Color:
Although it doesn't make sense to me to copy one series into another (at least in this context), but have you tried using PrintDebug or PlotSeries to answer your own question? In Wealth-Lab, strike F11 key and start typing in the first characters to find out more. Hope that helps.
Size:
Color:
@Cone (ref. #9 above)
Your post fixed helped me fix the problem I was having. I understand what you are saying, practically. Does that mean that in my code below (you;ll see where I modified to follow your post) I am actually shifting DS sp500LastYear one year forward, **instead of** what I thought I was doing originally: shifting DS sp500Today one year back? In other words the >> and << operators are manipulating the new DS being created, not the data in the one it was derived from?
CODE:
Please log in to see this code.
Size:
Color:
QUOTE:
In other words the >> and << operators are manipulating the new DS being created, not the data in the one it was derived from?
Yes, your understanding is correct.
Size:
Color:
Thanks.
Robert
Size:
Color: