Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

darthtrader2.0

Ninja Traders...lets Build a Better Mousetrap

Recommended Posts

This thread is inspired by david22's post about neoticker in another thread and building internals for non NYSE markets...

I know this is neoticker's game and this is my last ditch attempt before I just buy neoticker...

I blew away one of my machines the other day and played around with the neoticker demo today but I just don't like the program.

So the first question is, has anyone here ever messed around with multi instrument strategy plots in Ninja? I know currently it is possible to construct some form of the tick client side from the datafeed with onmarketdata() and strategyplot() but I do not know if Ninja/our machines/memory can handle creating the SPX in real time..I'm pretty sure not...

NT7 is promised to have multiple instrument indicators so I'm on hold with neoticker until I see what that can do.

How many instruments that will support in real time is the key...While I do not expect to be able to calculate the S&P cash market from the individual stocks(even though this would rule because it would gives us a real time, tick precise PREM) there should be a work around as far as pruning the list down from 500.

A simple correlation between the move of security X and the S&P cash over a good sample size should do the trick there with a cutoff point, I suspect the list is much smaller than what we probly think.

The other reason then I want to stick with ninja is its not that hard to override plot()..OHLC and candles are simply a terrible way to visualize the data of TICK...we already know the bounds of the data, a distribution at N time makes alot more sense.

Share this post


Link to post
Share on other sites
This thread is inspired by david22's post about neoticker in another thread and building internals for non NYSE markets...

I know this is neoticker's game and this is my last ditch attempt before I just buy neoticker...

I blew away one of my machines the other day and played around with the neoticker demo today but I just don't like the program.

So the first question is, has anyone here ever messed around with multi instrument strategy plots in Ninja? I know currently it is possible to construct some form of the tick client side from the datafeed with onmarketdata() and strategyplot() but I do not know if Ninja/our machines/memory can handle creating the SPX in real time..I'm pretty sure not...

NT7 is promised to have multiple instrument indicators so I'm on hold with neoticker until I see what that can do.

How many instruments that will support in real time is the key...While I do not expect to be able to calculate the S&P cash market from the individual stocks(even though this would rule because it would gives us a real time, tick precise PREM) there should be a work around as far as pruning the list down from 500.

A simple correlation between the move of security X and the S&P cash over a good sample size should do the trick there with a cutoff point, I suspect the list is much smaller than what we probly think.

The other reason then I want to stick with ninja is its not that hard to override plot()..OHLC and candles are simply a terrible way to visualize the data of TICK...we already know the bounds of the data, a distribution at N time makes alot more sense.

 

Hi darth,

Using the strategyplot to display markets internals is quite easy to do and also using it to calculate and display some indicators based on a few instruments is quite easy but if the list is too big NT won't handle it (I can't say what is the limit though...).

I think you're right by saying that we could bring down the number but it would require some quantitative analysis which would be probably better to do outside NT (you can plug NT to a statistical software).

 

Do you use some statistical software?

Share this post


Link to post
Share on other sites
Hi darth,

Using the strategyplot to display markets internals is quite easy to do and also using it to calculate and display some indicators based on a few instruments is quite easy but if the list is too big NT won't handle it (I can't say what is the limit though...).

I think you're right by saying that we could bring down the number but it would require some quantitative analysis which would be probably better to do outside NT (you can plug NT to a statistical software).

 

Do you use some statistical software?

 

Hey ryker,

Can you define what is too big as far as ninja goes here as far as your experience? I've mostly been waiting to see what they do in 7 as far as the the multi instrument indicator stuff...i'm sure that won't be much different than in strategies...

If its 100 vs 500 that is cool..if its 500 vs 3...not so good...

Statistical software wise I've messed around with R but never found anything that wasn't easier to do with Excel...Excel is probly robust enough, certainly for this kind of thing..

Output to the Ninja window with commas is kind of a pain for large datasets to save/paste/import into excel but certainly impossible and easier than any other solution I've found at my level of programming....

Share this post


Link to post
Share on other sites

I've never done any testing in NT regarding what is the maximum number of instruments we can add in the strategy. But it all depends on your actual setup and also on your computer.

 

I'll run some tests this week by adding a few instruments in a blank strategy and then running some simple calculations on them.

 

As for NT7, I don't think the multi instrument indicator would be too much different thant the multi instrument strategy but NT7 will support multiple cores so if you have a powerful CPU you should be able to have a bigger list than in NT6.5.

 

I saw NeoBreath and it looks quite cool, I don't think that NT7 would have something similar and the multi instrument indicator won't be probably as quick as NeoBreath (although I'd like to be wrong here :)).

Share this post


Link to post
Share on other sites

Oh I had not heard that that NT7 will support multiple cores..thats fantastic...

I'm going to try to build TIKI over the thanksgiving holiday. I guess the problem with that is I'm sure ninja can handle 30 custom series like that if its just doing addition and subtraction. I would think at some point memory becomes a bigger issue than actual CPU useage but I could be totally off there.

As far as neobreadth, isn't the the ease of that have to do with the fact that neoticker handles the list of single equities behind the scenes?

We could potentially do something like that pulling from a text file with a for loop in Initialize():

 

for (blah blah)

Add("X", PeriodType.Minute, 1);

Share this post


Link to post
Share on other sites

Well I messed around with this on the weekend and just loaded it up.

Bad news is my calculations make no sense and the plot is bogus but the good news is Ninja seems to be handling 30 manually added instruments like cakewalk..

In intialize I just did:

Add("AA", PeriodType.Minute, 1);

Add("AXP", PeriodType.Minute, 1);

Add("BA", PeriodType.Minute, 1);

Add("BAC", PeriodType.Minute, 1);

ect, ect..

 

then in onbarupdate (set to calculate on close false)

for(x = 0;x < 29; x++)

{

if(Closes[0][x] > LastTransactedPrice)

{Direction = 1;}

 

ect ect

So 30 instruments work and a for loop works, this should be doable. I couldn't figure out how to do this by overriding onmarketdata() but hopefully this will be good enough. Once I get the logic right I'll see if I can crash it with the S&P100.

Share this post


Link to post
Share on other sites
Does ninja generate a bar update event if any data series changes or just if the first one does?

 

Well I think I just got TIKI going just now and spitting out the DOW stock data to the ninja output window its updating all the data series extremely fast. I'm not sure if its on the first dataseries or on all them though, I just loaded up SPY so that even if it needs a tick from the main dataseries to update, SPY is more than fast enough.

This is certainly better than the 5 second lag I get on DTN.

Going to drink some coffee and grunt through adding the S&P 100 right now.

 

Bump: Lame...well it appears Ninja has a 50 instrument limit as fas as add() goes.

Above this the strategy loads but doesn't switch on.

very disappointing considering how smoothly its handling 50 instruments.

tickTIKI.thumb.jpg.fc19a35c784a6bdd6762bc2af9224e21.jpg

Share this post


Link to post
Share on other sites

Well nevermind, the ninja guys said that its probly an issue with my dataprovider in that I can only use 50 streams at once.

This might be worth looking into as on my average computer, 50 instruments is only using 25% of the cpu.

 

That 3 strategies idea is interesting but I don't think ninja can communicate between strategies currently? Either way though I guess this is a function of the dataprovider and computer, there is no limit on the software..

If anyone wants to mess with this here is the code for the S&P 100..

 

protected override void Initialize()

{

 

Add("AA", PeriodType.Minute, 1);

Add("AAPL", PeriodType.Minute, 1);

Add("ABT", PeriodType.Minute, 1);

Add("AEP", PeriodType.Minute, 1);

Add("AES", PeriodType.Minute, 1);

Add("AIG", PeriodType.Minute, 1);

Add("ALL", PeriodType.Minute, 1);

Add("AMGN", PeriodType.Minute, 1);

Add("AVP", PeriodType.Minute, 1);

Add("AXP", PeriodType.Minute, 1);

Add("BA", PeriodType.Minute, 1);

 

Add("BAC", PeriodType.Minute, 1);

Add("BAX", PeriodType.Minute, 1);

Add("BHI", PeriodType.Minute, 1);

Add("BK", PeriodType.Minute, 1);

Add("BMY", PeriodType.Minute, 1);

Add("BNI", PeriodType.Minute, 1);

Add("C", PeriodType.Minute, 1);

Add("CAT", PeriodType.Minute, 1);

Add("CBS", PeriodType.Minute, 1);

Add("CI", PeriodType.Minute, 1);

 

Add("CL", PeriodType.Minute, 1);

Add("CMCSA", PeriodType.Minute, 1);

Add("COF", PeriodType.Minute, 1);

Add("COP", PeriodType.Minute, 1);

Add("COV", PeriodType.Minute, 1);

Add("CPB", PeriodType.Minute, 1);

Add("CSCO", PeriodType.Minute, 1);

Add("CVS", PeriodType.Minute, 1);

Add("CVX", PeriodType.Minute, 1);

Add("DD", PeriodType.Minute, 1);

 

Add("DELL", PeriodType.Minute, 1);

Add("DIS", PeriodType.Minute, 1);

Add("DOW", PeriodType.Minute, 1);

Add("EMC", PeriodType.Minute, 1);

Add("EP", PeriodType.Minute, 1);

Add("ETR", PeriodType.Minute, 1);

Add("EXC", PeriodType.Minute, 1);

Add("F", PeriodType.Minute, 1);

Add("FDX", PeriodType.Minute, 1);

Add("GD", PeriodType.Minute, 1);

 

Add("GE", PeriodType.Minute, 1);

Add("GOOG", PeriodType.Minute, 1);

Add("GS", PeriodType.Minute, 1);

Add("HAL", PeriodType.Minute, 1);

Add("HD", PeriodType.Minute, 1);

Add("HIG", PeriodType.Minute, 1);

Add("HNZ", PeriodType.Minute, 1);

Add("HON", PeriodType.Minute, 1);

Add("HPQ", PeriodType.Minute, 1);

Add("IBM", PeriodType.Minute, 1);

 

Add("INTC", PeriodType.Minute, 1);

Add("IP", PeriodType.Minute, 1);

Add("JNJ", PeriodType.Minute, 1);

Add("JPM", PeriodType.Minute, 1);

Add("KFT", PeriodType.Minute, 1);

Add("KO", PeriodType.Minute, 1);

Add("MA", PeriodType.Minute, 1);

Add("MCD", PeriodType.Minute, 1);

Add("MDT", PeriodType.Minute, 1);

Add("MER", PeriodType.Minute, 1);

 

Add("MMM", PeriodType.Minute, 1);

Add("MO", PeriodType.Minute, 1);

Add("MRK", PeriodType.Minute, 1);

Add("MS", PeriodType.Minute, 1);

Add("MSFT", PeriodType.Minute, 1);

Add("NOV", PeriodType.Minute, 1);

Add("NSC", PeriodType.Minute, 1);

Add("NYX", PeriodType.Minute, 1);

Add("ORCL", PeriodType.Minute, 1);

Add("OXY", PeriodType.Minute, 1);

 

Add("PEP", PeriodType.Minute, 1);

Add("PFE", PeriodType.Minute, 1);

Add("PG", PeriodType.Minute, 1);

Add("PM", PeriodType.Minute, 1);

Add("QCOM", PeriodType.Minute, 1);

Add("RF", PeriodType.Minute, 1);

Add("RTN", PeriodType.Minute, 1);

Add("S", PeriodType.Minute, 1);

Add("SLB", PeriodType.Minute, 1);

Add("SLE", PeriodType.Minute, 1);

 

Add("SO", PeriodType.Minute, 1);

Add("T", PeriodType.Minute, 1);

Add("TGT", PeriodType.Minute, 1);

Add("TWX", PeriodType.Minute, 1);

Add("TXN", PeriodType.Minute, 1);

Add("TYC", PeriodType.Minute, 1);

Add("UNH", PeriodType.Minute, 1);

Add("UPS", PeriodType.Minute, 1);

Add("USB", PeriodType.Minute, 1);

Add("UTX", PeriodType.Minute, 1);

 

Add("VZ", PeriodType.Minute, 1);

Add("WB", PeriodType.Minute, 1);

Add("WFC", PeriodType.Minute, 1);

Add("WMB", PeriodType.Minute, 1);

Add("WMT", PeriodType.Minute, 1);

Add("WY", PeriodType.Minute, 1);

Add("WYE", PeriodType.Minute, 1);

Add("XOM", PeriodType.Minute, 1);

Add("XRX", PeriodType.Minute, 1);

 

 

 

Total = 0;

Add(StrategyPlot(0));

StrategyPlot(0).Plots[0].Pen.Color = Color.Blue;

StrategyPlot(0).PanelUI = 2;

CalculateOnBarClose = false;

}

protected override void OnBarUpdate()

{

//

 

if (BarsInProgress != 0)

return;

Total = 0;

for(x = 1;x < 50; x++)

{

// Print(Closes[x][0]);

if(Closes[x][0] > Closes[x][1])

{Total++;}

if(Closes[x][0] < Closes[x][1])

{Total--;}

 

}

StrategyPlot(0).Value.Set(Total);

}

Edited by darthtrader3.0beta

Share this post


Link to post
Share on other sites
its updating all the data series extremely fast. I'm not sure if its on the first dataseries or on all them though,

 

My thinking was that if it generates an event on every stream then you could get rid of the loop and just update the stream (subtract old value and add new value) of the series that generated the event. Hope I am makin sense just woke up from my afternoon nap :D

Share this post


Link to post
Share on other sites
My thinking was that if it generates an event on every stream then you could get rid of the loop and just update the stream (subtract old value and add new value) of the series that generated the event. Hope I am makin sense just woke up from my afternoon nap :D

 

Hmm I'm not totally sure what you mean..Ninja is a bit confusing on this stuff because if calculateonbarclose is true, then close() is like the close of a candle stick...if its false, then close() is just an incoming tick..but then if you want to know if the tick transacted at the bid or the ask you have to override onmarketdata()..I dont think what I did is truely tick precise for each of the stock dataseries because that loop is only firing on each tick of the primary instrument, but like I said on how heavy SPY is, this should be more than enough speed.

All the loop is doing in what I posted is marching through the added dataseries and looking to see if the last tick of each dataseries is higher or lower than 1 tick back of that dataseries to add up up vs downticks. I'm not sure it would really be more effecient to not loop as there is really very little calculations going on. Its really just 50 comparisons and 50 additions or subtractions on each tick.

I would love to try to get the PREM like this someday but with the multiplication to compute the weighting on each stock for the index, that might be unrealistic computing power wise on a tick basis.

Share this post


Link to post
Share on other sites

It would be probably better to write this in OnMarketData I think and not in OnOrderUpdate.

 

As for the loop, I think you should get rid of it, cause as the OnOrderUpdate is fired every new tick, you'll end up adding or substracting 50 times for one tick (hope this makes sense?). You only want to increment total on a new tick.

 

I'm not sure on the calcul that needs to be done. Is it for every new tick, it tick up then total++, if tick down then total--?

Uptick if the ask is hit, and downtick if it's the bid.

 

Is that correct?

Bump:

I think that something like the following should do what you want:

/// <summary>

/// Called on each incoming real time market data event

/// </summary>

protected override void OnMarketData(MarketDataEventArgs e)

{

if (e.MarketDataType != MarketDataType.Last || e.MarketData.Ask == null || e.MarketData.Bid == null)

return;

if (e.Price >= e.MarketData.Ask.Price) { total++; UVOL += e.Volume; }

if (e.Price <= e.MarketData.Bid.Price) { total--; DVOL += e.Volume; }

}

 

Remove everything in OnBarUpdate, and only keep it for StrategyPlot, then keep also initialize.

Also, I've added calculation for UVOL and DVOL (but not sure if this is correct though).

PS: I haven't tested this yet, I've just written it quickly.

Edited by ryker

Share this post


Link to post
Share on other sites

I think it would be better to do with OnMarketData but I don't completely understand it..I guess I wasn't looking at it abstractly enough as I was thinking that it was more linked to market data on the primary instrument as opposed to any market data on any data series in the strategy...

The calculation is as you said, for every new tick(of each stock that has been loaded as an additional instrument), if tick up then total++, if tick down then total--...The primary instrument is really just a place holder for the strategy and has nothing to do with the calculations. I'll mess around with it tomarrow and see what happens.

One thing I'm not sure about though is things didn't look right until I reset the total to zero on each tick, then ran the loop..so basically taking an uptick/downtick snap shot on each tick of SPY for what the summed uptick/downticks looked like on the underlieing instruments.

Volume could be really interesting for doing like an S&P TICK delta indicator but I don't see how you can get away with not weighting things. 1000 shares of XOM at the ask needs to have greater meaning than a 1000 shares at the ask of Disney, since the 1000 shares of XOM has greater meaning as far as calculating the index itself.

How would you go about calculating the cash index from the the 500 S&P stocks? I was thinking of eventually trying to have a Struct for each stock with Price, Bid Volume, Ask Volume and the index weighting..then 500 custom dataseries for holding the structs...if that was possible you would literally be able to do anything you want as far as breadth goes but I'm sure that is not the optimal way to do things by a long shot..

Edited by darthtrader3.0beta

Share this post


Link to post
Share on other sites

The way I would calculate the cash is have an arrays of 1..500 of last prices of each constituent and an array of 1..500 of weights. When a new event is generated because one of the constituents has a new tick I would add the difference between the last price and the new price multiplied by the weight to the index. Then move the new price into the last price array. This relies on the event that triggers things passing an 'index' to which data series triggered the event so you can get at the appropriate array element.

Share this post


Link to post
Share on other sites

Sounds like a plan...

The only part that I'm not sure about is the event triggering the index. Add() is going to create 500 seperate dataseries no matter what and as long as there is some get function to get the index of the data series that had an event, then the remaining calculations should be straight forward.

good stuff..What I posted about structs doesn't make any sense, I guess you could just even use a 4d array and store price, bid volume, ask volume, weight..then you have everything.

One thing to keep in mind with all this is NT7 might have a different way of handling OnMarketData because currently you can't backfill anything you do with that while NT7 is going to have backfill for bid/ask volume, ect...Not sure how they are going to handle this. Losing everything if you reload the chart midday is the biggest reason I haven't bothered to get too into OnMarketData. Thats always annoyed me greatly.

Share this post


Link to post
Share on other sites

I think you can use BarsInProgress as your index here.

 

You need to construct an array with the weight associated to each index and access it using BarsInProgress. You can store lastPrice as well as suggested by BlowFish to calculate the index value.

 

It should not be too hard to implement adding some code in the version of OnMarketData I wrote above.

 

But you're right though, that if you refresh your chart you'll lose everything... I'm not sure that NT7 would bring backfill but at least you'll have backwards compatibility (from what they said on their forum) so you should be able to continue to use your code with NT7.

Share this post


Link to post
Share on other sites

The exiting thing (for me) that NT7 is supposed to have tick by tick chart backfill refresh for all data streams regardless of timeframe. Opens up a whole range of possibilities similar to NeoTickers tick precise technology.

Share this post


Link to post
Share on other sites
I think you can use BarsInProgress as your index here.

 

Ahh yea, I see that would work. How would you do that though? I have a hard time not thinking in loops, the only way I can see to do that would be in on market data like:

for(i = x, x < 499,x++)

if(BarsInProgress == x)

do something

return;

 

Have you guys ever ran across documentation for all the methods in ninja? It seems like there should be some kind of Get.BarsInProgress() method but I've never found that level of documentation or maybe I'm just missing a bigger overall concept.

 

The big things I've read about for NT7 are the tick backfill for everything, multi instrument and time frame indicators, plotting the same instrument on one chart(still not sure if this means plotting the same instrument in price chart 1, that would be sick). I did read the other day though the beta is pushed back to the end of Q1 09, which kind of sucks but oh well.

 

Bump: Here is another question maybe you guys would know the general programming concept for..

I would love to eventually override plot to produce a kind of 5 or 15 minute distribution profile for TICK, like the volume profile or market profile of TICK values but it plots a new one every 5 or 15 minutes. I think that would be a far better way to see how the TICK is going off as opposed to candles or line on close.

I've dug into the volume profile indicator enough to get the general idea of how they pulled that monster off..

What I don't understand though is how you would store things to chop it up into different time intervals.

Volume profile uses a sorted dictortionary/hash table, so would you just use a custom data series of sorted dictionarys and set the chart to whatever time period you want and override the plot?

I guess in a more general sense I don't understand how to start these kind of calculations new for each bar..Another easier example would be say you wanted to find the average price for a 5 minute bar on a tick by tick basis..So keep a running total of the value of each tick divided by a running count of ticks..

If you do this in OnMarketData...how would you tell it to reset the tick value and counter to zero when the next bar starts?

Share this post


Link to post
Share on other sites

About the BarsInProgress, it holds an int value, so it is the index you're looking for here.

If you do it this way:

for(i = x, x < 499,x++)

if(BarsInProgress == x)

do something

return;

 

You'll end up doing too many operations for nothing (but it also depends on what you're trying to achieve here).

 

Let's say you have an array of weight called myArray, then you need to do that:

/// <summary>

/// Called on each incoming real time market data event

/// </summary>

protected override void OnMarketData(MarketDataEv entArgs e)

{

if (e.MarketDataType != MarketDataType.Last || e.MarketData.Ask == null || e.MarketData.Bid == null)

return;

if (e.Price >= e.MarketData.Ask.Price)

{ total++;

UVOL += e.Volume * myArray[barsInProgress]; }

if (e.Price <= e.MarketData.Bid.Price)

{ total--;

DVOL += e.Volume * myArray[barsInProgress]; }

}

 

PS: It's just an example, I'm not entirely sure this is the correct way of calculating UVOL & DVOL.

 

For your question, I think you'll need to create a custom data series of arrays (if possible?) that holds the values you want and then plot that (but I'm not sure I understood what you try to do here).

 

Use if (FirstTickOfBar) to reset your values in OnOrderUpdate with a 5min serie and calculateonbarclose set to false.

Share this post


Link to post
Share on other sites

haha nice...I wasn't even thinking that BarsInProgress is the index itself, so no reason to search for it.

if (FirstTickOfBar) was what I was looking for as far as a general concept goes for those other questions...I think I'm going to try to build a plot of the intrabar POC/PVP like what Market Delta does.. I always thought that was handy information. I'm pretty sure custom data series can hold an array of any other data structure..How to do this is all right there in the Volume Profile indicator that comes with Ninja, very slick programming in that thing.

 

My only real complaint about Ninja is while their forum is amazing for what they do support, discussions like this quickly falter with the "we don't support this" post that will eventually come. Thanks a bunch for letting me toss the ball around with someone who knows alot more than I...

Share this post


Link to post
Share on other sites

Well this has nothing to do with TICK but could be interesting, I believe the logic is correct.

This chart is basically a "moving average" that is just connecting the average price of a 5 minute bar to the next average price of a 5 minute bar tick wise.

One thing that sticks out on any chart is that on a move most the bar is under the average price line. Could be usefull as far as a filter to not get in if price is on the wrong side of the average line if thats the direction your looking to trade. Doing this with an intrabar vwap might also be quite interesting.

#region Variables

// Wizard generated variables

private int myInput0 = 1; // Default setting for MyInput0

private double Counter = 1;

private double AvgPrice = 0;

private DataSeries myDataSeries;

// User defined variables (add any user defined variables below)

#endregion

protected override void Initialize()

{

Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));

myDataSeries = new DataSeries(this);

CalculateOnBarClose = false;

Overlay = false;

PriceTypeSupported = false;

}

 

/// <summary>

/// Called on each bar update event (incoming tick)

/// </summary>

protected override void OnBarUpdate()

{

 

if (FirstTickOfBar)

{

AvgPrice = 0;

Counter = 0;

}

 

AvgPrice += Close[0];

Counter++;

myDataSeries.Set(AvgPrice / Counter);

Plot0.Set(myDataSeries[0]);

}

5aa70e9e475c6_SPY12_3_2008(5Min).thumb.jpg.5f2dc2b4d287b06916b669e7bd424e4b.jpg

Share this post


Link to post
Share on other sites

It looks like that your average price is the close of the bar (would make sense if this indicator has been applied on historical data I think)?

Have you tried doing this on an intraday vwap price yet?

Share this post


Link to post
Share on other sites

Yea I don't know, I'm kind of confused after spending some time with this thing.

While the bar is moving live the average price wiggles around, but I've only seen a few bars when the average price line closes that its not at the close of the bar...I'm talking maybe 1% of the time??

Maybe it has something to do with using close[0]?

 

I mean this logic is correct right?

AvgPrice += Close[0];

Counter++;

AvgPrice / Counter;

 

I tried getting the average vwap going but it didn't seem any different than the average...I don't know if that was a problem with my logic or if intra bar the volume weighting just doesn't have enough time to really weight things differently than the straight out average before a new bar.

Share this post


Link to post
Share on other sites

The logic looks fine but I think you should use this indicator from start of day till end of day without any refresh. Otherwise on historical data your code will return Close[0] / 1.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • Yeah agree, trading with Hotforex helped me to realise how important is a trading plan. 
    • $WTRH Waitr Holdings stock strong close with a breakout watch above 3.24, volume 40% above normal , see https://stockconsultant.com/?WTRH
    • $KOPN Kopin stock strong trend with a breakout watch above 1.5 , see https://stockconsultant.com/?KOPN
    • https://nationalfile.com/dershowitz-defends-ghislaine-maxwells-character-as-he-sues-epstein-victim-for-accusing-him-of-rape/ ANOTHER DISGUSTING DECREPID PEDOPHILE FUCKING JEW CUNT NOT HUMAN just sayin'
    • Dictionary Thesaurus Medical Dictionary Legal Dictionary Financial Dictionary Acronyms Idioms Encyclopedia Wikipedia Encyclopedia Tools A A A A Language:     Mobile Apps: apple android For surfers: Free toolbar & extensions Word of the Day Bookmark Help For webmasters: Free content Linking Lookup box Close Correct all you're your grammar errors instantly. Try it now. useless Also found in: Thesaurus, Medical, Legal, Idioms, Encyclopedia, Wikipedia. Related to useless: indubitably, predecessor, abruptly use·less  (yo͞os′lĭs) adj. 1. a. Being or having no beneficial use; ineffective: This pen is useless because it's out of ink. See Synonyms at futile. b. Having no purpose or reason; pointless; to no avail: It's useless to argue over matters of taste. 2. Incapable of acting or functioning effectively; ineffectual or inept: He panics easily and is useless in an emergency. use′less·ly adv. use′less·ness n. American Heritage® Dictionary of the English Language, Fifth Edition. Copyright © 2016 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company. All rights reserved. useless (ˈjuːslɪs) adj 1. having no practical use or advantage 2. informal ineffectual, weak, or stupid: he's useless at history. ˈuselessly adv ˈuselessness n Collins English Dictionary – Complete and Unabridged, 12th Edition 2014 © HarperCollins Publishers 1991, 1994, 1998, 2000, 2003, 2006, 2007, 2009, 2011, 2014 use•less (ˈyus lɪs) adj. 1. of no use; not serving the purpose or any purpose; unavailing. 2. without useful qualities; of no practical good. [1585–95] use′less•ly, adv. use′less•ness, n. Random House Kernerman Webster's College Dictionary, © 2010 K Dictionaries Ltd. Copyright 2005, 1997, 1991 by Random House, Inc. All rights reserved. ThesaurusAntonymsRelated WordsSynonymsLegend: Switch to new thesaurus Adj. 1. useless - having no beneficial use or incapable of functioning usefully; "a kitchen full of useless gadgets"; "she is useless in an emergency" ineffective, ineffectual, uneffective - not producing an intended effect; "an ineffective teacher"; "ineffective legislation" unprofitable - producing little or no profit or gain; "deposits abandoned by mining companies as unprofitable" unserviceable - not ready for service; "unserviceable equipment may be replaced" useful, utile - being of use or service; "the girl felt motherly and useful"; "a useful job"; "a useful member of society" Based on WordNet 3.0, Farlex clipart collection. © 2003-2012 Princeton University, Farlex Inc. useless adjective 1. worthless, of no use, valueless, pants (slang), ineffective, impractical, fruitless, unproductive, ineffectual, unworkable, disadvantageous, unavailing, bootless, unsuitable He realised that their money was useless in this country. worthless useful, practical, valuable, effective, productive, fruitful, workable, advantageous 2. pointless, hopeless, futile, vain, idle, profitless She knew it was useless to protest. pointless worthwhile, profitable 3. (Informal) inept, no good, hopeless, weak, stupid, pants (slang), incompetent, ineffectual He was useless at any game with a ball. Collins Thesaurus of the English Language – Complete and Unabridged 2nd Edition. 2002 © HarperCollins Publishers 1995, 2002 useless adjective 1. Having no useful purpose: ineffectual, inutile, unusable, worthless. 2. Incapable of being used or availed of to advantage: impracticable, impractical, unnegotiable, unserviceable, unusable, unworkable. 3. Having no useful result: barren, bootless, fruitless, futile, unavailing, unprofitable, unsuccessful, vain. Idiom: in vain. 4. Not having the desired effect: ineffective, ineffectual, inefficacious, inefficient. The American Heritage® Roget's Thesaurus. Copyright © 2013, 2014 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company. All rights reserved. Translations Spanish / Español Select a language: inútil useless [ˈjuːslɪs] ADJ 1. (= ineffective) [object] → que no sirve para nada; [person] → inútil this can opener's useless → este abrelatas no sirve para nada compasses are useless in the jungle → las brújulas no sirven para or de nada en la selva she's useless → es una inútil he's useless as a forward → no vale para delantero → no sirve como delantero I was always useless at maths → siempre fui (un) negado or un inútil para las matemáticas 2. (= unusable) [object, vehicle] → inservible; [limb] → inutilizado, inútil he's a mine of useless information! (hum) → se sabe todo tipo de datos y chorraditas que no sirven de nada to render or make sth useless → inutilizar algo 3. (= pointless) → inútil it's useless to shout → de nada sirve gritar, es inútil gritar Collins Spanish Dictionary - Complete and Unabridged 8th Edition 2005 © William Collins Sons & Co. Ltd. 1971, 1988 © HarperCollins Publishers 1992, 1993, 1996, 1997, 2000, 2003, 2005 use2 (juːs) noun 1. the act of using or state of being used. The use of force to persuade workers to join a strike cannot be justified; This telephone number is for use in emergencies.uso, utilización 2. the/a purpose for which something may be used. This little knife has plenty of uses; I have no further use for these clothes.uso 3. (often in questions or with negatives) value or advantage. Is this coat (of) any use to you?; It's no use offering to help when it's too late.utilidad 4. the power of using. She lost the use of her right arm as a result of the accident.uso 5. permission, or the right, to use. They let us have the use of their car while they were away.uso ˈuseful adjective helpful or serving a purpose well. a useful tool/dictionary; She made herself useful by doing the washing for her mother.útil ˈusefulness noun utilidad ˈusefully adverb in a useful way. He spent the day usefully in repairing the car.útilmente ˈuseless adjective having no use or no effect. Why don't you throw away those useless things?; We can't do it – it's useless to try.inútil be in use, be out of use to be used or not used. How long has the gymnasium been in use / out of use? en uso/desuso, dar un uso/no darle un uso come in useful to become useful. My French came in useful on holiday. resultar útil have no use for to despise. I have no use for such silliness / silly people. no querer saber de it's no use it's impossible or useless. He tried in vain to do it, then said `It's no use.' es inútil make (good) use of, put to (good) use He makes use of his training; He puts his training to good use in that job. sacar partido/provecho de Kernerman English Multilingual Dictionary © 2006-2013 K Dictionaries Ltd. useless → inútil Multilingual Translator © HarperCollins Publishers 2009 useless adj inútil English-Spanish/Spanish-English Medical Dictionary Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Want to thank TFD for its existence? Tell a friend about us, add a link to this page, or visit the webmaster's page for free fun content. Link to this page:   Facebook Twitter     Finally, Farlex brings you all the rules of English grammar, all in one place, explained in simple terms. The Farlex Grammar Book is available now in paperback and eBook formats. Feedback Finally, all the rules of English Grammar in one place. Explore The Farlex Grammar Book now for FREE. Flashcards & Bookmarks ? Please log in or register to use Flashcards and Bookmarks. You can also log in with Facebook Twitter Google+ Yahoo TheFreeDictionary presents: Write what you mean clearly and correctly. Correct all you're your grammar errors instantly. Try it now. Mentioned in ? aidless anopheles anopheline barren bauchle bitslag bogotify boonless bootless bootlessness Cassate destroy discard dissipation Disutilize dud duff dufferdom effectless References in classic literature ? "I purposely abstain from troubling you by any useless allusions to myself. Vanstone has left it, seems like taking a journey for nothing -- and my staying in London appears to be almost equally useless. View in context The adult might become fitted for sites or habits, in which organs of locomotion or of the senses, &c., would be useless; and in this case the final metamorphosis would be said to be retrograde. View in context Mordaunt tried for a moment to read in the general's face if this was simply a useless question, or whether he knew everything. View in context Useless! The air had made the flame attached to the conductor more active; the match, which at rest might have burnt five minutes, was consumed in thirty seconds, and the infernal work exploded. View in context The attempt proved to be useless, and worse--it seemed to make her suspicious. View in context But while he was seeking with thimbles and care, A Bandersnatch swiftly drew nigh And grabbed at the Banker, who shrieked in despair, For he knew it was useless to fly. View in context During the scene of tumult, Andrea had turned his smiling face towards the assembly; then, leaning with one hand on the oaken rail of the dock, in the most graceful attitude possible, he said: "Gentlemen, I assure you I had no idea of insulting the court, or of making a useless disturbance in the presence of this honorable assembly. View in context "It is useless, mother, to speculate on what might have happened. View in context I'm glad there's something to give my life for, for it's not simply useless but loathsome to me. View in context Those who tried to understand the general course of events and to take part in it by self-sacrifice and heroism were the most useless members of society, they saw everything upside down, and all they did for the common good turned out to be useless and foolish- like Pierre's and Mamonov's regiments which looted Russian villages, and the lint the young ladies prepared and that never reached the wounded, and so on. View in context That is to say, justice is useful when money is useless? View in context More results ►   Dictionary browser ? ▲ Usbegs Usbek USC USCA USCB USCG USD USDA USDAW use use immunity use of force policy use of goods and services use up useable useableness use-by date used used to used-car used-car lot usedn't useful usefully usefulness useless uselessly uselessness Usenet usen't user user group user interface user-definable user-defined key user-friendliness user-friendly username user-unfriendly Ushant U-shaped U-shaped valley Ushas usher usher in usher out Usherance Usherdom usherette ushering in Usherless ▼ Full browser ? ▲ usefully usefulness usefulness usefulness usefulness usefulness usefulness usefulness Usefulness of Training Topics for Domestic Violence Questionnaire usefulnesses usefulnesses USEG usege usege usege USEI USEIA USEIC USEIGHT Usein Kysytyt Kysymykset Useinov, Mikael Useinov, Mikael Aleskerovich USEIR Useit USEITI USEK USEL USELC USELEMCMOC USELEMNORAD useless useless as an ashtray on a motorbike useless as tits on a boar hog useless as tits on a bull useless as tits on a nun Useless Bits of Information Useless Fact of the Day Useless Inert Nothing Useless Information for You Useless Information Society Useless language Useless languages Useless Management Overhead Useless Movie Quotes Useless Piece of Information Useless Piece of Stuff Useless S. Grant Useless S. Grant Useless use of cat Useless Use of Grep Useless, Unsuccessful, And/Or Unpopular Memes uselessly uselessly uselessness uselessness USELMNORAD USELMS USEM usen't Usenbaev, Alymkul Usenet ▼ Correct all you're your grammar errors instantly. Try it now. Facebook Share Twitter CITE   Site: Follow: Facebook Twitter Rss Mail Share: Facebook Twitter LinkedIn Mail Open / Close More from Dictionary, Thesaurus, and Translations Mobile Apps Apple Android Kindle Windows Windows Phone Free Tools For surfers: Free toolbar & extensions Word of the Day Bookmark Help For webmasters: Free content Linking Lookup box Terms of Use Privacy policy Feedback Advertise with Us Copyright © 2003-2020 Farlex, Inc Disclaimer All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.    
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.