PriceActionTrader
New member
Hi,
Since forex does not have "true volume," I want thinkorswim to plot forex futures volume in the volume subgraph for all major pairs. For example, the "EUR/USD" chart should plot the volume subgraph for "/6E" (the symbol for Euro FX futures). if I then switch to "AUD/USD," thinkorswim should automatically plot the volume subgraph for "6A."
I am using a study that breaks down volume for non-forex instruments, which colors volume bars to indicate the amount of buy/sell volume. I have modified the code so it looks like this:
I think there's an obvious mistake I'm making, but I can't put my finger on it. Can anyone point me in the right direction?
Thanks
Since forex does not have "true volume," I want thinkorswim to plot forex futures volume in the volume subgraph for all major pairs. For example, the "EUR/USD" chart should plot the volume subgraph for "/6E" (the symbol for Euro FX futures). if I then switch to "AUD/USD," thinkorswim should automatically plot the volume subgraph for "6A."
I am using a study that breaks down volume for non-forex instruments, which colors volume bars to indicate the amount of buy/sell volume. I have modified the code so it looks like this:
Code:
#HINT: This study color codes volume by amount of volume on up-tick versus amount of volume on down-tick
declare lower;
def O = open;
def H = high;
def C = close;
def L = low;
def V;
if (GetSymbol() == "EUR/USD") {
V = Volume("6E");
} else if (GetSymbol() == "USD/JPY") {
V = Volume("6J");
} else if (GetSymbol() == "GBP/USD") {
V = Volume("6B");
} else if (GetSymbol() == "USD/CAD") {
V = Volume("6C");
} else if (GetSymbol() == "AUD/USD") {
V = Volume("6A");
} else if (GetSymbol() == "MXN/USD") {
V = Volume("6M");
} else if (GetSymbol() == "NZD/USD") {
V = Volume("6N");
} else if (GetSymbol() == "EUR/GBP") {
V = Volume("RP");
} else { #BASE CASE
V = Volume;
}
def Buying = V*(C-L)/(H-L);
def Selling = V*(H-C)/(H-L);
# Selling Volume
Plot SV = selling;
SV.setPaintingStrategy(PaintingStrategy.Histogram);
SV.SetDefaultColor(Color.Red);
SV.HideTitle();
SV.HideBubble();
SV.SetLineWeight(5);
# Buying Volume
# Plot BV = Buying;
# Note that Selling + Buying Volume = Volume.
Plot BV = V;
BV.setPaintingStrategy(PaintingStrategy.Histogram);
BV.SetDefaultColor(Color.Dark_Green);
BV.HideTitle();
BV.HideBubble();
BV.SetLineWeight(5);
I think there's an obvious mistake I'm making, but I can't put my finger on it. Can anyone point me in the right direction?
Thanks
Last edited: