Post by Ira on Feb 11, 2010 14:04:20 GMT -5
HHII!
thanks for helping me....
now I'm thinking even bigger, can the TOS give me data like distance (in points) between the arrows?
that would be AWESOME!! ;D ;D ;D
heres the code from the Average Cross:
# @new
#
# thinkorswim, inc. (c) 2009
#
#wizard input: price
#wizard text: crosses
#wizard input: crossingType
#wizard input: averageType1
#wizard input: averageType2
#wizard text: average length
#wizard input: length1
#wizard text: average2 length
#wizard input: length2
#wizard text: within
input price = close;
input length1 = 15;
input length2 = 30;
input averageType1 = {default Simple, Exponential, Weighted, Wilders};
input averageType2 = {default Simple, Exponential, Weighted, Wilders};
input crossingType = {default above, below};
def avg1;
switch (averageType1) {
case Simple:
avg1 = Average(price, length1);
case Exponential:
avg1 = ExpAverage(price, length1);
case Weighted:
avg1 = wma(price, length1);
case Wilders:
avg1 = WildersAverage(price, length1);
}
def avg2;
switch (averageType2) {
case Simple:
avg2 = Average(price, length2);
case Exponential:
avg2 = ExpAverage(price, length2);
case Weighted:
avg2 = wma(price, length2);
case Wilders:
avg2 = WildersAverage(price, length2);
}
plot signal = crossover(crossingType == CrossingType.above, avg1 > avg2);
signal.DefineColor("Above", GetColor(6));
signal.DefineColor("Below", GetColor(7));
signal.AssignValueColor(if crossingType == CrossingType.above then signal.color("Above") else signal.color("Below"));
signal.SetPaintingStrategy(if crossingType == CrossingType.above
then PaintingStrategy.BOOLEAN_ARROW_UP
else PaintingStrategy.BOOLEAN_ARROW_DOWN, yes);
basically what we talked abou is painting the bars according to the arrows. for example, if the arrow pointing down, that bar (or the bar right after that) should be red all along the way until an up arrow appear and from that point on it should appear green... :)
I'm trying to make the avg cross more visually.
also, if it can give me after arrow appears (and of course the bar closes so the arrow is permanent) the distance in point from the previous bar... that would make an awesome indicator!!!1
on a more personal note i wish TOS had the same thing i know trade station has and its a method to back test strategies... that could be a very powerful tool in our arsenal. but trade station cost like HELL!!!
THANKSSSSSSSSSSS A-LOT.
I would love to know to program TOS like you do, i have so many creative ideas but i don't know anything about programing.
thanks a lot!
thanks for helping me....
now I'm thinking even bigger, can the TOS give me data like distance (in points) between the arrows?
that would be AWESOME!! ;D ;D ;D
heres the code from the Average Cross:
# @new
#
# thinkorswim, inc. (c) 2009
#
#wizard input: price
#wizard text: crosses
#wizard input: crossingType
#wizard input: averageType1
#wizard input: averageType2
#wizard text: average length
#wizard input: length1
#wizard text: average2 length
#wizard input: length2
#wizard text: within
input price = close;
input length1 = 15;
input length2 = 30;
input averageType1 = {default Simple, Exponential, Weighted, Wilders};
input averageType2 = {default Simple, Exponential, Weighted, Wilders};
input crossingType = {default above, below};
def avg1;
switch (averageType1) {
case Simple:
avg1 = Average(price, length1);
case Exponential:
avg1 = ExpAverage(price, length1);
case Weighted:
avg1 = wma(price, length1);
case Wilders:
avg1 = WildersAverage(price, length1);
}
def avg2;
switch (averageType2) {
case Simple:
avg2 = Average(price, length2);
case Exponential:
avg2 = ExpAverage(price, length2);
case Weighted:
avg2 = wma(price, length2);
case Wilders:
avg2 = WildersAverage(price, length2);
}
plot signal = crossover(crossingType == CrossingType.above, avg1 > avg2);
signal.DefineColor("Above", GetColor(6));
signal.DefineColor("Below", GetColor(7));
signal.AssignValueColor(if crossingType == CrossingType.above then signal.color("Above") else signal.color("Below"));
signal.SetPaintingStrategy(if crossingType == CrossingType.above
then PaintingStrategy.BOOLEAN_ARROW_UP
else PaintingStrategy.BOOLEAN_ARROW_DOWN, yes);
basically what we talked abou is painting the bars according to the arrows. for example, if the arrow pointing down, that bar (or the bar right after that) should be red all along the way until an up arrow appear and from that point on it should appear green... :)
I'm trying to make the avg cross more visually.
also, if it can give me after arrow appears (and of course the bar closes so the arrow is permanent) the distance in point from the previous bar... that would make an awesome indicator!!!1
on a more personal note i wish TOS had the same thing i know trade station has and its a method to back test strategies... that could be a very powerful tool in our arsenal. but trade station cost like HELL!!!
THANKSSSSSSSSSSS A-LOT.
I would love to know to program TOS like you do, i have so many creative ideas but i don't know anything about programing.
thanks a lot!