Consulting

Page 4 of 13 FirstFirst ... 2 3 4 5 6 ... LastLast
Results 61 to 80 of 244

Thread: Bet Angel and Excel

  1. #61
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    Hi Sam:

    IYO would it be faster to use the current system with two workbooks?
    I used an addin in the application that I wrote, but I have no comparison with using two instantiations of EXCEL. At a guess I wouldn't think it would make much difference. I would hope that EXCEL would work out the multi threading as best it could either way.

    I think the way you have designed it; keeping everything in memory, gives this a good chance of working either way .

    I am still not sure whether a "free for all" with all the objects competing for processor time is the optimal way of organising this, or whether some sort of scheduler is going to be necessary. Is there going to be some way fo preventing one UDO getting priority over the the others. We don't need to recalculate everything all the time. It this going to be part of the EXCEL Helper??

  2. #62
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,812
    Location
    This will be part of the Helper Book

    Only new data will "raise" a Calculation. Since all Calculations occur in Child UDOs, the Main "Brand" Class can regulate when new data is added to a Child Object. This can easily be done with each Objects Ready Property. If needed.

    "Ready" merely idicates that an Object is done computing it's outputs.

    For Example the MACD Object uses three child Calculator Objects. When each Child is "Ready," the MACD is "Ready."

    What do you think? Should those Caculator Objects have a single input value that can be either an array or a single value, or should they have two (SeriesIn* is W/O) Properties, an Array and a singleton? I'm thinking that a "Initialized" R/O Property can tell the Main Parent Object(s) which to use.
    If UDO.Initialized THen
    UDO = Singleton 'Value is Default UDO Property
    Else
    UDO.SeriesIn = Series
    End If
    Inside the Calculator
    Property Let SeriesIn(*)
    pValue = CalculateSeries(SeriesIn)
    End Property
    Property Let Value(*)
    pValue = CalculateSingleton(Value)
    End Property
    Property Get Value()
    Value = pValue
    End Property

    I am thinking that an If... Then... Else... that assumes Initialized is a very fast method of decision making
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #63
    VBAX Contributor
    Joined
    Sep 2017
    Posts
    128
    Location
    22711981_10155830266507767_1164743788_o.jpg
    Hi lads. I look forward to helping develop the BA help app once it’s up and running, I should be able to assist in some small way from the start and even more as I grow in confidence and ability. I know all about never ending lists, I am a Year 4 teacher in a local primary school and there just aren’t enough hours in the day! I hope you get your water running soon and good luck with the knee!

    I am currently running excel on a 13-inch mid 2010 MacBook Pro with a 2.4GHz Intel Core 2 Duo processor and 2GB 1067 MHz DDR3 memory (I have bigger memory modules ready to transfer in). I am running Windows on a partitioned hard drive (with about 80GB of free space). With regard to excel, I am currently running Microsoft Excel 2016 MSO 32-bit. Is anything after 2007 i.e. 2016 fine for multithreading? For quicker speeds, safety and efficiency I was thinking of eventually, or rather really soon, upgrading to a private VPS/VPN. Would this work or are there implications that arise with these? BA offer a standard one by the looks of things but only with average speeds of 30ms, I’m sure there are better online…
    https://www.betangel.com/vps/

    Apologies if I have missed anything, here are my replies to Sam’s notes:
    No need to keep the results, I have been working on a way of recording P/L via BetAngel after the races have ended.

    If Range("P45:P103").Value = "PLACED" Then Range("PLACED").ClearContents
    Very important!

    Yes, whenever I say 3 seconds I mean a look period of 15 iterations.

    Money flow index (Uses the difference of money flow (volume at best three back and best three lay prices in it’s calculation so it’s a more detailed formula to show volatility than WOM I assumed, its purpose is to show false signals and again be a ‘confirmation’ trigger but if WOM does this adequately IYO then that’s fine.

    By front four runners I mean the ones that are trading the most prior to the 10 minute out period when my system will start. These will be locked in position (Rows H, J, L, N) to avoid confusion.

    Regarding back/lay (see the attached picture):

    Please excuse the crude sketch of a random oscillating wave. This example follows a RSI. The first signal is when the RSI line (Check it’s only one line) crosses above the 30 mark so I will ‘Buy’ or ‘Back’ when it crosses the 50 line, I will ‘Sell’ or ‘Lay’. Then Lay when it crosses from above the 70 line, Back when it crosses the 50 line. On top of this, if a signal reverts back to it’s original position i.e. in the first example, the crosses above the 30 mark but it could then have dropped back below 30 instead of crossing the 50, in this instance I would ‘Close Trade’. I believe this is the simplest system that I can then tweak, add to and develop further in the future for all indicators. The only difference between this and a conventional RSI is I don’t just buy at over/under sold levels but exit trades when they reach stability again – this level can and will be tweaked with. Now once these ‘triggers’ activate they need to be ‘remembered’ within a look back period of 15 so if all three triggers activate within 15 intervals of one another, a ‘Back’, ‘Lay’, or ‘Close Trade’ will commence.

    To open a trade at all, all three must trigger. To close a trade, whether that be ‘Back’, ‘Lay’ or ‘Close trade’, only two out of the three indicators will need to cross the trigger threshold within a 15 period of each other. Hopefully this simple trigger system will help in your decision regarding your last post. I understand the first part of having separate child calculation objects running independently but not whether it should have a single input value or have two, sorry; hopefully something offthelip knows the answer to.

    The MFI (If used) will work the same way. The MACD will simply be when the lines cross above the signal (as default) then a “Back” will trigger, if the line crosses below the signal line then “Lay”.

    Just to clarify before I do this wrong, what do you mean by you want me to arrange BA data columns? You want me to make a new template sheet like the one BetAngel have supplied with the green and white stripes but with information most relevant to my system? How will we direct information to go into the correct cells. Do I need to use/manipulate the current set up or am I missing the point altogether?

    Cheers,

    CPerry.

  4. #64
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    Hi Cperry:
    I am running Windows on a partitioned hard drive (with about 80GB of free space). With regard to excel, I am currently running Microsoft Excel 2016 MSO 32-bit.
    Does this mean that you are running Microsoft office (EXCEL) under windows as a virtual Machine on your Macbook Pro, or are you running the Mac version of Microsoft Office?

    2.4GHz Intel Core 2 Duo processor and 2GB 1067 MHz DDR3 memory
    Is a fairly slow machine by modern standards. Also I notice you are using the 32 bit version of EXCEL. the 64bit version is much faster (in theory).

    The good news about this is that you have got plenty of scope to improve perfomance by upgrading to a faster machine. I agree with Sam's suggestion get yourself a gaming desktop machine, with a cheap video card.
    Just as an aside I always use a gaming keyboard with my desktop because the response is so much better and faster. ( I never play games on the computer!!)

  5. #65
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    Hi Sam:
    What do you think? Should those Caculator Objects have a single input value that can be either an array or a single value, or should they have two (SeriesIn* is W/O) Properties, an Array and a singleton? I'm thinking that a "Initialized" R/O Property can tell the Main Parent Object(s) which to use.
    I think that when initialising a calculator using it is useful to be able to pass an array, ( see the initialisation in my RSI function) however when running I think we should always pass a single variable, since this is all that is necessary and it will minimise the calculations. The only exception to this is if Cperry adds any indicators that are not based on EMA type calculations, currently all the indicators are based on EMA calculations.
    Also I think the calculator object should store the whole series from when it starts ( it is all in RAM anyway so won't take any time or significant space.) this can be useful when trying to debug the system. i.e when looking at it, we think it should have triggered and we find it doesn't or vice versa. By having a record of every calculation will allow us to go over it in detail to find where the code has gone wrong. So I think the calculator object should have three gets for values , get single value ( the latest), get 15 values ( last 3 seconds) , get the whole lot, however many it is.

  6. #66
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,812
    Location
    Is anything after 2007 i.e. 2016 fine for multithreading?
    They will all Multi-thread, but I haven't found a way to put the Helper Excel into it's own process after 2010. IMO, the fastest will be keeping each instance of Excel as separate as possible.

    Keep in mind that Excel is a native Microsoft Application. MACs must jump thru loops to run it, thus slowing it down. I think that a Windows 7 machine with Excel 7 will provide more ROE than a VPN. On Ebay, today, I saw Office 7 suites for $25us and up and many Windows 7 CD's for less than $50us. On Craig's List, here in Missouri, there are many high end Gaming Computers from $500us to $2500us.

    Just to clarify before I do this wrong, what do you mean by you want me to arrange BA data columns?
    The less interactivity BA has with the Excel Worksheet, the faster the entire system will be. Interacting with a Worksheet always takes a relatively large amount of time and CPU cycles.

    The more BA Data you can remove from the BA sheet, the better. All I, as a coder, want to see on that worksheet, is the Data my Code needs to work with. Do the best Bet Angel will let you get away with. Keeping in mind that you will want to refine your system in the future, however, just keep it to Races for the nonce.
    e
    The "Custom Settings" sheet, on the third hand, should be developed with a cell for every possible current and future setting. This is where you define what possible values to use in the Projects calculations. For example, You might use WOM or Monet Flow; Define all settings that either may use, Remember that I defined different Smoothing and Series Length inputs for all three WOM series thus allowing for future use right at the beginning. I will try to get a sample "Custom Settings" Sheet for you to start with.

    How will we direct information to go into the correct cells.
    Via the "Custom Settings" worksheet.

    WOM does this adequately IYO then that’s fine.
    That is a decision you must make. I just design the App so it will be "easy" for you to experiment.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  7. #67
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,812
    Location
    I think that when initialising a calculator using it is useful to be able to pass an array, ( see the initialisation in my RSI function) however when running I think we should always pass a single variable, since this is all that is necessary and it will minimise the calculations.
    Oh, yeah!

    Also I think the calculator object should store the whole series from when it starts
    I'm thinking to keep all that in the Data Accumulator Object, with a possible Upper limit set on the Custom Settings Sheet. This also allows for simple Whole Race Logging if the User wants. It still allows for testing of all calculations that need any length series.

    I see the Data Flow as:

    1. The BA Worksheet_Change Pushes the entire BA Data Table to the BA.Output Object
    2. The Helper.Accumulator, Pulls the latest BA Data Table from the Output Object
      1. The Acumulator parses the Data and appends it into a FIFO Object, by Brand Name.

    3. Each Helper.Brand Object Pulls it's data, by name and series length, from the Accumulator.
    4. Each Brand object parses this data by Fields and Pushes it to the Calculator Objects.
      1. The Calculators only store the last input and the output



    #3 Acculumator Method:
    Public Function Value(BrandName As String, Optional SeriesLength As Long = 1) As Variant
    'Code TBD
    End Function
    I will see if one can set a Let .Value Sub as the Default Property and if that sets the .Value Method as the default Output Property. It would be nice
    Accumulator = BA.OutPut
    Me.SeriesInput = DataAccumulator(Me.Name, SeriesLength)
    I am starting to think that the DataAccumulator Object will be doing as much work as the rest of the Helper book put together. See 2.a above.

    NOTE TO SELF: Each Objects inputs set pReady = False. Each Object has IsReady Procedure to check all Child Objects Ready Property. If all Child's are True, sets Parent's pReady to True.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  8. #68
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    I'm thinking to keep all that in the Data Accumulator Object, with a possible Upper limit set on the Custom Settings Sheet. This also allows for simple Whole Race Logging if the User wants. It still allows for testing of all calculations that need any length series.
    I like the idea of this, it keeps all of the series in one place, it will make it easier to spot timing issues between different parts of the system.

    Each Brand object parses this data by Fields and Pushes it to the Calculator Objects.The Calculators only store the last input and the output

    So I presume that the Brand object is going to push the new indicator values back to the Data accumulator object.

    Is the Brand object also going to be the one that tests last 15 samples of the three indicators to see is a trigger has occured, or will you do that in another object. I would favour a separate object for doing this partly to make the Brands object simpler ( but not simple!!) and also to make changing it easier.

    I am not sure where the split between a 20ms update rate and a 200ms update rate is occuring in your model, is it the Helper.Accumulator that is going to do this, so the FIFO per brand name is updated every 200 ms (10 frames) of is the Brand object going to do this, so it only call the calculator units once every 10 updates?

  9. #69
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    Hi Cperry,
    You need to expand on your set of rules for the RSI trigger: because I can see a number of conditions that you have not catered for, eg:
    1: What happens if the RSI drops below 50, so you open a sell, and then it goes up to 70 without going below 30 ( this is very likely to happen). do you open a second sell.
    2: If the rSI goes above 50 so you open a buy and then drop below 50, do you sell immediately? If the indicator is oscillating around 50 you could burn up a lot of money being "whipsawed"
    3: If the RSI drops below 30 and the comes above 30 but the drop through 30 again do you open 2nd buy position ?

    I am not sure I have catered for all conditions here, but you must think about the full set of rules you need, computers are really dumb, they only do what you tell them,

  10. #70
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,812
    Location
    So I presume that the Brand object is going to push the new indicator values back to the Data accumulator object.
    I hadn't considered that. I would probably Push the results to a different Object, just for debugging logging. Turn it off for speed during Production runs. Just another Custom Setting.

    I am not worried about Startup and Initialization times. I consider that to be a Capital Expense. I want to minimise Operating Expenses, CPU load and Time. The only OE I want is the Calculator Objects, and, data Passage and Parsing. Everything else should be a Capital Expense.

    Is the Brand object also going to be the one that tests last 15 samples of the three indicators to see is a trigger has occurred,
    Do that in another object.

    where the split between a 20ms update rate and a 200ms update rate is occuring in your model,
    I'm ignoring CPU Timing. The Brand Object is all based on when an object is ready. Since the Main Brand Object is "Ready=True" as soon as all its Children are ready, It will trigger another round of Calculating and data Transfer as often as programmatically possible. I think that as soon as the Brand Object Pushes its Decisions to the Excel Helper Application's CellPrinter UDO, the Brand starts over with the latest BA output.

    In Fact, the Excel Helper Application's CellPrinter UDO might be the one to log that data stream. It will be in a different Process.

    NOTES TO SELF: All Parent or Container, Objects need Ready=True Event
    pReady = Child1.Ready And Child2.Ready And...

    Do While Not pReady 'Any good ideas for this?
    DoEvents
    Loop
    
    'Ouput all data, Main Brand Object only
    Application.CellPrinterObj = Me.Data 'Array
    pReady = False
    
    'Or, Output Data, then
    Do While pReady 'OutputValue Property Gets cumulatively reset pReady to False when read
    DoEvents
    Loop
    
    Me.Start Over



    Local and Global Reset Methods
    Method ResetGlobal() Passes ReSetGlobal to all Childs
    Method Reset("Child") Passes ResetGlobal To Named Object
    Need good ChildCollection Object
    Need pPArent Object in each Child







    @ All
    Given good Child Collections and pParent Objects, can a grandChild and a grandParent use each others Properties?

    As simple as GloballyUniquePropertyName = X?
    Or something like Me.Parent.Parent.Property = X?



    Can a Cell in one instantiation of Excel refer to anything in an different Instantiation of Excel?
    How?



    Thanks. Off to DuckDuckGo now
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  11. #71
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,812
    Location
    From my Previous:
    Can a Cell in one instantiation of Excel refer to anything in an different Instantiation of Excel?
    How?
    DuckDuckGo Says, https://support.microsoft.com/en-us/help/555159
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  12. #72
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,812
    Location
    From my Pre-Previous
    From grandParent to grandChild
    Duckduckgo says:
    https://stackoverflow.com/questions/...l-class-module
    http://vbi.org/Items/article.asp?id=78
    http://www.vbaexpress.com/forum/show...Keyword-in-VBA



    @ CPerry, you might want to look at this since we are doing a lot of talking about, and your Project is being built with, Class Modules.
    https://excelmacromastery.com/vba-class-modules/
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  13. #73
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,812
    Location
    This might be a good computer for you, 549 € and up, depending on selected internals
    https://slimbook.es/en/power-minipc-one

    They're in Spain, if that means anything,
    I'll bet they do customs.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  14. #74
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    I'm ignoring CPU Timing. The Brand Object is all based on when an object is ready. Since the Main Brand Object is "Ready=True" as soon as all its Children are ready, It will trigger another round of Calculating and data Transfer as often as programmatically possible
    I am worried about this, it is what I have been worried about right from the start. It is unneccessary to calculate everything as fast as possible and it will limit the thoughput if you do. I am not talking about CPU timings I am talking about update rates and iterations rates.

    The data update from BA comes in every 20 to 50 ms.
    Cperry has clearly stated that he would like to see an update every 200ms, which seems a reasonable update rate.
    To do the OHLC calculation the BRAND needs to check every update, but it doesn't need to recalculate the indicators or save the OHLC and start a new one.
    It only needs to do this once every 200ms. Also we do not need to upate all the Brand simulataneously.

    If you recalculate every Brand calculation as fast as you can, you are wasting processor time because you could well be doing the recalculations more frequently than once every 200ms. There is no requirement to calcualte the indicators that fast.
    This means that once you have two or three "brands" running you might run out of power. While if you recalculate each Brand only once every 200ms you can calculate far more of them.

    As an example assume it takes 10 ms to update one brand. If we recalculate two brands we will just about get this done in between data updates and everything is then running flat out.

    What happens if we now add a third brand? How is the processor time shared between the three brands? We know that we will get a data update before they are finished, what happens if one the Brands always finishes in less time that the others does that mean it gets calculated more frequently? What happens if the brand does a recalculation before the data had been updated.

    An EMA time series only works correctly if we have fixed (or at least known) time intervals between each data update. How are we supposed to calculate the Time constants for EMA if we don't know how often the series is being calculated.


    There is another issuse with this in that the requirement for a trigger is to look at the last 3 seconds worth of data and indicators. If you are writing data out as fast as you can, how are you going to tell how long the the array is going to be for 3 seconds worth?

    I still favour a deterministic approach where we control what is calculated and when as I outlined in my post #50.
    This will give us update for the calculated arrays every 200ms. The only issue being how we determine when the 200ms is due.

  15. #75
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,812
    Location
    It is unneccessary to calculate everything as fast as possible and it will limit the thoughput if you do.
    First A Question: Which is easier? Slow down an APP or Speed it up?

    As I see it, you are saying that is is faster to do a sequential calculation that takes a few thousand CPU tiks every 500 million CPU tiks than do perform the same sequential calculations on demand every several thousand CPU Ticks.

    This App is designed to be optimized for speed by both the VBA Compiler and the Windows Operating system. It has plenty of all needed delays built in, in fact I'm putting in too much delay, but all delays are fine tunable. That is something CPerry can do AFTER I have a FrameWork for him. The first such Delay is that the BA Application only outputs one table of Updated Data every ten updates. The Main Helper Controller Object cannot even Read the parsed Data until the Helper's DataParser gets done splitting all the BA data into Brand size Bites and turned its own (Read) Ready Property to True. Another built-in Delay is that the Main Controller Object must wait for every Brand Object to be Ready = True before it can Write new Data to it. Below that, The Brand Object is not Ready = True until A: it has completed all computations and B: it has passed all its outputs and is idle .

    You do brring up a thought about ThroughPut Timing snafuus, For Maximum speed of Throughput, I see a need for a Boolean Dictionary, keyed by Brand.Name and whose values are Brand.Readys, The Main Controller BrandUpdater UDO will use
    For Each Brnd in Brands Collection
    If BrandReadyDict (Brnd.Name).Ready
    Then Data Dump Brnd
    Maybe later if it's an issue

    An EMA time series only works correctly if we have fixed (or at least known) time intervals between each data update.
    There is no fixed time interval available, That is provided by an out Object over the internet.

    How are we supposed to calculate the Time constants for EMA if we don't know how often the series is being calculated.
    By using BA Update tiks, or as close to a constant fraction thereof as we can manage. Everybody involed undertands that an Update tic is as close a timing mark as is available. We cannot Force BA to follow any timing system we use. Our Timing must be based on the BA. The Curves the outputs are based on will be a little fuzzy, but close enough and a whole lot faster than using a TI Scientific calculator. The Prices in a Race just don't move that fast.

    If you are writing data out as fast as you can, how are you going to tell how long the the array is going to be for 3 seconds worth?
    When the BAUpdateTikCounter reaches about 150? 1500? Hmmmn. I think that Wild Turkey is getting between me and my brain.

    Please keep your comments coming, they're really helping me see things more clearly.

    Just what are we talking about besides Data Flow? Each Brand is only tracking three to six curves. There is a stated limit of About 30 Brands. 180 Calculations on a fast MultiCore with Multithreading? Plus the Boolean Decision Tree. Writing the data to Cells is NOT a Brand UDO function.

    @ CPerry, Think of a Class Module's (a UDO's) Property pVariable as the name of a particular address in RAM. The beauty of VBA's Classes is that a Child and a Parent can share the same piece of Memory with different Address Names. There is no Throughput overhead in that case. WAIT! I think that Turkey interpreted what I tried to say.

    Good night
    Sam
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  16. #76
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    The first such Delay is that the BA Application only outputs one table of Updated Data every ten updates. The Main Helper Controller Object cannot even Read the parsed Data until the Helper's DataParser gets done splitting all the BA data into Brand size Bites and turned its own (Read) Ready Property to True.
    This answers my question:

    I am not sure where the split between a 20ms update rate and a 200ms update rate is occurring in your model, is it the Helper.Accumulator that is going to do this, so the FIFO per brand name is updated every 200 ms (10 frames) of is the Brand object going to do this, so it only call the calculator units once every 10 updates?
    However it immediately raises another question:
    Who is doing the OHLC calculation.
    I presume from what you have said that the BA Application is not doing this, what this means is that once every 10 updates the BA application write out 10 updates, the Main helper unit process this and then the Brand unit goes through the 10 updates to do the OHLC calculation before it can start the indicator calculation.
    I sure you can see that if the BA application did the OHLC check on every update then when it came to do the update on the tenth update, there would only a single comparison to make and so the OHLC check will take less time on that particular update, also it would only need to output 4 variables instead of 10.
    Note I am not suggesting the BA application does the OHLC check, I am just using this to illustrate that controlling when calculations are done can improve throughput enormously.
    As I stated in my earlier post #50:
    Minimising the Maximum calculation time is one aspect of maximising throughput without loss of updates.
    There is no fixed time interval available, That is provided by an out Object over the internet.


    How are we supposed to calculate the Time constants for EMA if we don't know how often the series is being calculated.
    By using BA Update tiks, or as close to a constant fraction thereof as we can manage. Everybody involved understands that an Update tic is as close a timing mark as is available. We cannot Force BA to follow any timing system we use. Our Timing must be based on the BA. The Curves the outputs are based on will be a little fuzzy, but close enough and a whole lot faster than using a TI Scientific calculator. The Prices in a Race just don't move that fast.
    If we are going to use the BA updates as our “clock” we need to find out how accurate that is and how much it varies. Does the update rate vary depending on the race?, the number of horses?, the internet connection??, how long it is to the start of the race, does it vary during the 10 minutes up to the start of the race.
    Since one of the requirements is to get a reasonably accurate time dependent calculation, we need to be able to adjust our “smoothing” constants in the calculator objects depending on what the actual update rate is. We also need to cater for the last 3 seconds of data being a variable number of items.

    One thought I had for CPerry : “ Does betangel time stamp the updates?” if they do that would be great. ( Note in the financial application I did the data was time stamped, so problem solved)
    So if we are going for a variable recalculation rate ( max) we are going to need to do a lot of extra processing to sort out the time. Is this really going to give us a greater throughput than building it as a deterministic system where we control what gets updates and when?

  17. #77
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    I have been thinking further about how to solve the variable update rate problem which the system design has.
    We know that the Now() function gives an update every second.
    The BA Application could use this to count how many updates arrive every second. We could then use this as the "update rate" for the next second.
    Hopefully it won't change much between one second and the next.
    We can then use this factor to modify the "smoothing" constants" in all the calculation objects

    One way where we can test how accurate our timing is, is to creat a test object that just counts our "time" and then outputs it so that we can check it against a time recorded from the computer.

  18. #78
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,812
    Location
    Taking them in order, as I am answering before reading both posts.
    I presume from what you have said that the BA Application is not doing this, what this means is that once every 10 updates the BA application write out 10 updates, the Main helper unit process this and then the Brand unit goes through the 10 updates to do the OHLC calculation before it can start the indicator calculation.
    Every ten pdates the BA Outputs one update.

    e need to find out how accurate that is and how much it varies. Does the update rate vary depending on the race?, the number of horses?, the internet connection??,
    It is what it is, but, it's in one of my previously attached Zipped text files. Average about 51 ms, occasionally, 102ms. Ballpark.

    We also need to cater for the last 3 seconds of data being a variable number of items.
    Thei Items count is specific = 180seconds / (~51ms x 10 / Other delays) or 15 (or) 140 items.Ask CPerry for specific number. It totally depends on BA over the web, the Worksheet_Change Event, and all other delays. The change event test log says updates @ ~ 50 ms.

    We know that the Now() function gives an update every second.
    The BA Application could use this to count how many updates arrive every second. We could then use this as the "update rate" for the next second.
    Hopefully it won't change much between one second and the next.
    BTDT. See The change event test log.

    "Perfect is the enemy of good." due to all things considered, we can't do perfect. We're aiming for goodest.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  19. #79
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    Every ten pdates the BA Outputs one update.
    So Ba must do the OHLC calculation.

    It is what it is, but, it's in one of my previously attached Zipped text files. Average about 51 ms, occasionally, 102ms. Ballpark.
    So you are making assumptions that it is going to be good enough. What are you going to do if it isn't accurate enough?? How are you going to determine whether it is accurate enough?

    What I have been trying to do by "reviewing" the design is to draw attention to possible problem areas particularly where a modification at this stage will allow for greater flexibility later when any possible problems appear.

    You are obviously welcome to ignore my comments about time and how I believe that keeping accurate time is going to be important for this application.

    I notice from your post #18:

    I love teaching. And Programming. I've been doing one or both for 47 years.
    Unfortunately I have to admit that I have been doing it even longer, I started as a trainee programmer at IBM in 1968 in my first vacation at University
    More significant , I specialised in high tech realtime applications and I have been working on real time systems since 1974. (The very first one I worked on had an update every 50ms, which was darn quick in those days!!)

    I think Cperry should be grateful that there is nearly 100 years of experience going into developing this app!!

  20. #80
    VBAX Contributor
    Joined
    Sep 2017
    Posts
    128
    Location
    22768255_10155836159452767_837368803_o.jpg
    Wow a lot here which is excellent so let me just reply as I read through each post in turn.
    I have asked my dad’s friend to get me a good gaming computer with the specs you have mentioned previously and a 64-bit version of Windows Excel 7, this running on a Windows 7 machine should be with me very soon.

    Again, please excuse yet another crude drawing of an oscillator but if you see my drawing (attached file) I think I have shown what you correctly pointed out I had missed last time. That being, when the line crosses back above areas that don’t really benefit me.
    The purpose to this is to have more customisation capability, instead of just one/off at 30 and 70 levels, or having a single kill at 50 (for both directions), I can experiment with changing these variables.

    I will now go through each cross over point in turn:
    1) Crossover below 70 so "Lay"
    2) Crosses 50 "Back" or "Close Trade" Woo hoo profit, hopefully!
    3) Crosses below 70 once more so "Lay"
    4) Crosses above 70 (either ignore being so soon after the first cross or cancel - which would you say?)
    5) Crosses below 70 again. (Depending on the last cross, we now either have a double stake or a fresh "Lay")
    6) Crosses 50, woo profit!
    7) Crosses above 30, "Back"
    8) Crosses 50, "Close Trade"
    9) "Lay"
    10) "Close Trade"
    11) "Back"
    12) Polar opposite as crossover 4, either "Back again" or ignore as being so close to the previous cross point??
    13) "Back"
    14) "Close Trade"

    So the question is, double the back/lays each time there is a cross or put an ignore command in if so close? We also need to consider the impact this will have on the bigger picture, is it worth 'ignoring' if it doesn't trigger anyway? No bet will activate unless all three indicators react so, what do you think? Martingale double triggers, or ignore them if they don’t activate within 3 seconds of the other two triggers? This format can easily be replicated in other indicator models that I may use.

    Other indicators? Black Scholes, Fibonacci, Stochastic Oscillators, CCI etc. Most of what I’m starting out with follows basic moving averages but then gets more complex. At the moment, I’d just like to get something working that I can build upon. As you said in your last post, perfection is unlikely – great will do for now until I have time to really build upon it. I can not wait to get this running and really get into the knitty grittiness of the real markets.

    I can take away from the main sheet: Stall number, Reduction Factor, Projected Starting Price and Actual Starting Price. This is the area to the right of the green and white stripes. I am keeping ‘Volume Weighted Average Price’ as this I expect will be useful for future calculations. I am looking into stripping away even more, i’ve posed the question in the forum so hopefully a more experienced user will give me the most efficient way of doing this. I have also asked the question about time stamps just for future reference.

    The other cells are useful as I still need to include a "Green_All" about 10 seconds before the start, so this is when the VBA code needs to end. I was simply going to do this via a function as there will be no other processes commencing at this time for the CPU to fight for.

    One thing I am still unsure of, and you may very well know the answer offthelip, is in regard to quicker and more volatile markets. For example, those instances when the market shoots up with money still waiting, if I don’t get matched at 4.5 and the market suddenly drops to 3.5, I have missed the opportunity to make some decent profit. any tips for getting ahead of the price in volume-heavy volatile markets?

    Cheers,
    CPerry.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •