Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

Re: Re: Error while updating

Integrated Application Platform › Forums › General › Error while updating › Re: Re: Error while updating

November 28, 2012 at 7:53 pm #948
amckinlay
Keymaster

Hi Ajith,

Good to hear from you after so long! I hope you are well.

I ran it here. I think this is the part of the output you are looking for:

329.88 prev_EMA: 330.39 difference: -3.34 rec_price: 327.05 rec_date: #20101110
[macdhisto: -329.53, aroonup: 4, ema: 329.94, open: 335, aroondown: 60, high: 345.6, sma: 329.455, turnover: 34002.51, low: 325.55, date: #20101110, ttq: 10217605, ltp: 327, calc2: 329.47, serialno: 217, calc1: 329.83, macd: -.06, vol_sign: "neg", close: 327.05]
327.82 prev_EMA: 329.83 difference: -13.08 rec_price: 316.75 rec_date: #20101111
[macdhisto: -327.99, aroonup: 4, ema: 328.96, open: 325.45, aroondown: 100, high: 326.75, sma: 328.065, turnover: 22661.5, low: 316, date: #20101111, ttq: 7070523, ltp: 317.2, calc2: 326.93, serialno: 218, calc1: 327.86, macd: -1.06, vol_sign: "neg", close: 316.75]

It seems the same as what you are talking about.

I do not understand what it is doing exactly, but I can suggest some possible issues:

Doing a Query1 to get the previous record will use a separate transaction from the QueryApply, so it will get the record before the update (since the QueryApply transaction does not get committed till the very end). If you want it to get the new updated record then you need to do transaction.Query1 using the same transaction as the QueryApply. To do this you can wrap the loop in a Transaction block and use t.QueryApply and t.Query1. Or you can get the QueryApply transaction using rec.Transaction() e.g.

t = rec.Transaction()
prevrec = t.Query1(stockname, serialno: (rec.serialno -1))

If I do this, I get:

329.88 prev_EMA: 330.39 difference: -3.34 rec_price: 327.05 rec_date: #20101110
[macdhisto: -329.53, aroonup: 4, ema: 329.94, open: 335, aroondown: 60, high: 345.6, sma: 329.455, turnover: 34002.51, low: 325.55, date: #20101110, ttq: 10217605, ltp: 327, calc2: 329.47, serialno: 217, calc1: 329.88, macd: -.06, vol_sign: "neg", close: 327.05]
327.86 prev_EMA: 329.88 difference: -13.13 rec_price: 316.75 rec_date: #20101111
[macdhisto: -327.99, aroonup: 4, ema: 328.96, open: 325.45, aroondown: 100, high: 326.75, sma: 328.065, turnover: 22661.5, low: 316, date: #20101111, ttq: 7070523, ltp: 317.2, calc2: 326.93, serialno: 218, calc1: 327.86, macd: -1.06, vol_sign: "neg", close: 316.75]

But maybe you do not need to do Query1 at all? You can just have a variable for the previous record, and do prev_rec = rec at the end of the loop. Although this would not supply a prev_rec for the first loop.

I hope that helps.

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language