How can I make a Indicator (For example Moving Average) work for the
combination of a Instrument on a chart.
Lets say I combined a 1 minute Bid and 1min ask and a 1 Min trade chart for the mini S+P in one window as an overlay
How can I make a Moving Average Work for the 1 min bid/ask/trade Bar. (witch resulted because of the overlay)??
Indicator work for combined BID/ASK/TRADE Bar
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
Stanley,
I am trying to put on a BID/ASK data series (1Tick Bar) a Moving Average with a Length of 1 Period.
That way I expected to have a perfect Tick line Chart.
The problem is that the Moving average will only consider the Bid price only or the ask price only.
How can I make it work that the moving average calculates it from both prices.
As an additional explanation please take a look at the attached picture!
Many Thanks.
I am trying to put on a BID/ASK data series (1Tick Bar) a Moving Average with a Length of 1 Period.
That way I expected to have a perfect Tick line Chart.
The problem is that the Moving average will only consider the Bid price only or the ask price only.
How can I make it work that the moving average calculates it from both prices.
As an additional explanation please take a look at the attached picture!
Many Thanks.
- Attachments
-
- EXAMPLETICK.jpg
- (209.37 KiB) Downloaded 2022 times
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
As you can see prices on the attached chart are representing a series of prices. Non of these prices are coming in at the same time.
Non of the Dots are parallel at the same time on the chart.
I just want to say that the bid and the ask are a series of prices on your tick charts and could be considered as a stream of prices. Non of them is parallel.
I just wanted to connect them with eatch other to simulate a stream of prices.
Unfortunately I am not able to create custom symbols and synthatically simulate this flow of data into one stream.
I just want to connect one dot with the other since they are beneath eatch other on the chart no matter whether it is a bid or a ask price. I thought since I can do this on a bid only chart or ask only chart this could work on a bid/ask overlay as well because a Moving Average with a 1 bar length connects the dots with eatch other. How can I do this with a series of bid ask prices?
CQG has a function called BATS. You can choose tic charts that are a sereies of bid and ask prices. Unfortunately I cannot chart IB TWS IDEALPRO FOREX with CQG.
Once I saw your overlay of bid and ask prices (witch are also plotted as a flow or stram of bid and ask dots) of the EURUSD IDEALPRO FX I thought lets connect them with eatch other with a 1 bar length MOVING AVERAGE and I have my primary trading tool that I am used to working with CQG.
A BID/ASK tick chart. Usually this works with a couple of other programms but non of them can chart IB FOREX Data...........
Non of the Dots are parallel at the same time on the chart.
I just want to say that the bid and the ask are a series of prices on your tick charts and could be considered as a stream of prices. Non of them is parallel.
I just wanted to connect them with eatch other to simulate a stream of prices.
Unfortunately I am not able to create custom symbols and synthatically simulate this flow of data into one stream.
I just want to connect one dot with the other since they are beneath eatch other on the chart no matter whether it is a bid or a ask price. I thought since I can do this on a bid only chart or ask only chart this could work on a bid/ask overlay as well because a Moving Average with a 1 bar length connects the dots with eatch other. How can I do this with a series of bid ask prices?
CQG has a function called BATS. You can choose tic charts that are a sereies of bid and ask prices. Unfortunately I cannot chart IB TWS IDEALPRO FOREX with CQG.
Once I saw your overlay of bid and ask prices (witch are also plotted as a flow or stram of bid and ask dots) of the EURUSD IDEALPRO FX I thought lets connect them with eatch other with a 1 bar length MOVING AVERAGE and I have my primary trading tool that I am used to working with CQG.
A BID/ASK tick chart. Usually this works with a couple of other programms but non of them can chart IB FOREX Data...........
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
Stanley,
as you can see on the attached picture I overlayed a 1 min bid and a 1 min ask charts. The moving average is a simple one but works only for the
bid or the ask. How can I make it work for the whole bar. Not only the bid part or the ask part of the bar?
THX
as you can see on the attached picture I overlayed a 1 min bid and a 1 min ask charts. The moving average is a simple one but works only for the
bid or the ask. How can I make it work for the whole bar. Not only the bid part or the ask part of the bar?
THX
- Attachments
-
- picture3.png
- (112.42 KiB) Downloaded 1988 times
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
It's quite easy if you are using interval bars. Just apply Custom Line study and specify average( (close of data1 + close of data2) / 2, 14) as an input or create a new study:Stanley,
as you can see on the attached picture I overlayed a 1 min bid and a 1 min ask charts. The moving average is a simple one but works only for the
bid or the ask. How can I make it work for the whole bar. Not only the bid part or the ask part of the bar?
THX
Code: Select all
plot1(average( (close of data1 + close of data2) / 2, 14));
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
- Stanley Miller
- Posts: 556
- Joined: 26 Jul 2005
- Has thanked: 3 times
Here is my 'solution' to creating a 'synthetic' price series that represents a price half way between the Bid and Ask ticks.
The issue, as already stated, is that Bid ticks and Ask ticks do not normally occur at the same time, and therefore it is not possible to treat them as the same data series. They can be separately plotted, but not used as separate input data series to any function or indicator.
I believe the only way to use both the Bid and Ask prices as inputs to a function or indicator is if the separate price-series of Ticks are transformed into some kind of fixed-time-interval bars. That means you could use something VERY small such as 1-sec bars, if you want.
The other way is to transform each of the tick data series into an almost equivalent non-tick data series, such as the simplest moving average of length=1. THEN you have two data-series that are NOT tick data-series, per se, but is instead a 'normal' time-based data series. And then you can take the PRICE-average of these two TIME-average data series and you now have a data series that is half way between the two tick-data series.
So you have two ways to accomplish your objective: (1) convert each to 1-sec data series first, and/or (2) convert each (Bid and Ask) price series into a TIME-average (of Length=1).
Here is some example code for the second approach:
Step-1: create a 'function' that is VERY simple and short (for convenience), such as: (and call it MA1):
{MA1 function}
input: price(numericseries);
MA1 = (price +price[1])*0.5;
Step-2: create an indicator (to test, by plotting it):
{Plot simple MA , for length=1}
input: Price(close);
Plot1(MA1(price));
After compiling both, create a chart with only the Bid and Ask prices of some symbol. Create a 'Custom 1 Line' Indicator on the chart just created. Insert the following in the indicator input labeled 'Formula':
(MA1(close of data1) +MA1(close of data2))/2
Important: Remember to click the properties tap and select the Sub-chart#1, AND select the 'Scaling' tab and check the 'Scale Type' as "Same as Symbol'.
That is it ! You can see the BidAsk line 'solution', and you will also have a function that can be used in signals the same way it was used in the indicator.
Attached is an example plot, where I plotted both the Ask and Bid ticks, and the associated separate Bid and Ask TIME-series lines (shown as dotted). In between you will see the Aqua colored and thicker line of the simulated 'Trade' line that is half-way between the other two lines.
Hope that helps you .
The issue, as already stated, is that Bid ticks and Ask ticks do not normally occur at the same time, and therefore it is not possible to treat them as the same data series. They can be separately plotted, but not used as separate input data series to any function or indicator.
I believe the only way to use both the Bid and Ask prices as inputs to a function or indicator is if the separate price-series of Ticks are transformed into some kind of fixed-time-interval bars. That means you could use something VERY small such as 1-sec bars, if you want.
The other way is to transform each of the tick data series into an almost equivalent non-tick data series, such as the simplest moving average of length=1. THEN you have two data-series that are NOT tick data-series, per se, but is instead a 'normal' time-based data series. And then you can take the PRICE-average of these two TIME-average data series and you now have a data series that is half way between the two tick-data series.
So you have two ways to accomplish your objective: (1) convert each to 1-sec data series first, and/or (2) convert each (Bid and Ask) price series into a TIME-average (of Length=1).
Here is some example code for the second approach:
Step-1: create a 'function' that is VERY simple and short (for convenience), such as: (and call it MA1):
{MA1 function}
input: price(numericseries);
MA1 = (price +price[1])*0.5;
Step-2: create an indicator (to test, by plotting it):
{Plot simple MA , for length=1}
input: Price(close);
Plot1(MA1(price));
After compiling both, create a chart with only the Bid and Ask prices of some symbol. Create a 'Custom 1 Line' Indicator on the chart just created. Insert the following in the indicator input labeled 'Formula':
(MA1(close of data1) +MA1(close of data2))/2
Important: Remember to click the properties tap and select the Sub-chart#1, AND select the 'Scaling' tab and check the 'Scale Type' as "Same as Symbol'.
That is it ! You can see the BidAsk line 'solution', and you will also have a function that can be used in signals the same way it was used in the indicator.
Attached is an example plot, where I plotted both the Ask and Bid ticks, and the associated separate Bid and Ask TIME-series lines (shown as dotted). In between you will see the Aqua colored and thicker line of the simulated 'Trade' line that is half-way between the other two lines.
Hope that helps you .
- Attachments
-
- CombinedBidAskPrices.PNG
- (62.78 KiB) Downloaded 2010 times