php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62728 trader
Submitted: 2012-08-02 18:05 UTC Modified: 2012-08-02 19:05 UTC
From: mike at saymikeo dot com Assigned:
Status: Closed Package: Trader (PECL)
PHP Version: 5.3.15 OS: OSX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
12 + 2 = ?
Subscribe to this entry?

 
 [2012-08-02 18:05 UTC] mike at saymikeo dot com
Description:
------------
trader_odosc always returns 0

See data set below

thanks!


Test script:
---------------
$high = array(349.77, 352.32, 356.48, 347.84, 343, 339.61, 338.2, 339.74, 342.62, 340.22, 346, 352.06, 354.32, 350.96, 350.88, 349.8, 351.59, 344.6, 342.25, 343.9, 340.43, 340.15, 335.67, 333.73, 336.14, 336, 333.64, 332.23, 337.98, 345.75, 355.13, 353.75, 354.99, 352.35, 349.75, 353.95, 350.47, 349.89, 351.83, 350.95, 350, 349.2, 349.69, 350, 347.12, 346.25, 341.22, 336.14, 341.05, 342.41, 340.95, 335.98, 335.9, 338.56, 336.89, 337.63, 347.83, 352.13, 347.98, 345.33, 347.05, 338.22, 334.8, 333.67, 331.66, 328.31, 333.25, 330.3, 328.68, 329.25, 317.7, 325.8, 328.9, 331.69, 333.15, 333.9, 336.7, 336.37, 336.13, 343.5, 349.83, 354.1, 358, 360, 359.77, 357.68, 360, 361.61, 365, 374.65, 378.65, 396.27, 390.06, 395.05, 400, 404.5, 402.64, 396.99, 395.15, 399.5, 397.9, 393.55, 391.32, 383.5, 367.77, 374.61, 374.65, 375.45, 379.64, 384.97, 383.37, 384.52, 372.65, 367, 364.88, 373.64, 378.96, 375.45, 383.8, 391.5, 391.84, 392.08, 387.34, 378, 380.33, 385.6, 388.61, 386, 380.88, 386.21, 392.21, 393.66, 400.5, 413.23, 422.86, 421.59, 409.82, 406.74, 403.98, 409.25, 403.74, 402.21, 388.89, 382.64, 381.8, 379.82, 384.78, 377.74, 388.81, 403.18, 409.25, 408.43, 422, 426.7, 424.81, 408.42, 400.35, 399.14, 406.5, 406.55, 402.55, 409, 406.35, 409.33, 399.5, 400.44, 403.4, 403.44, 400, 408, 400.89, 397.21, 388.7, 385.25, 389.5, 391.14, 384.58, 379.99, 371.68, 377.93, 375.84, 371.15, 376.72, 378.83, 382.28, 389, 393.63, 396.41, 394.63, 390.94, 395.5, 394.04, 393.9, 395.4, 387.38, 383.74, 384.15, 384.85, 396.1, 397.3, 399.13, 403.59, 409.09, 408.25, 405.65, 406.28, 412.5, 414.68, 418.55, 422.75, 427.75, 426, 422.85, 422.9, 420.45, 425.99, 429.47, 431.37, 427.5, 428.45, 425.1, 454.45, 448.79, 448.48, 453.9, 458.24, 458.99, 457.17, 460, 464.98, 469.75, 476.79, 496.75, 497.62, 503.83, 509.56, 526.29, 504.89, 507.77, 514.85, 515.49, 517.83, 522.9, 528.5, 535.41, 547.61, 548.21, 546.8, 547.48, 533.69, 537.78, 542.99, 547.74, 552, 568.18, 594.72, 600.01, 589.2, 601.77, 606.9, 609.65, 604.5, 601.8, 607.15, 616.28, 621.45, 616.56, 610.56, 618.77, 632.21, 625.86, 634.66, 639.84, 644, 636.87, 631.33, 624.7, 610.28, 610, 620.25, 604.73, 594.62, 576.67, 567.69, 618, 614.69, 606.18, 598.4, 596.76, 587.4, 591.4, 578.36, 572.77, 571.5, 573.98, 575.88, 574.47, 567.51, 563.22, 556.89, 547.5, 543.41, 561.54, 573.88, 572.8, 576.5, 565.85, 574, 579.99, 581.5, 572.65, 567.5, 566.47, 573.85, 577.32, 580.58, 588.5, 576.62, 578.48, 573.5, 574.62, 587.89, 590, 589.25, 588.22, 582.19, 579.8, 574.49, 576.74, 574, 584);

$low = array(344.9, 345, 351.31, 340.1, 326.26, 330.66, 330, 335.26, 339.14, 335.95, 338.86, 347.02, 350.44, 346.06, 347.44, 346.06, 343.3, 338.4, 336, 337.14, 336.03, 333.95, 330.02, 330.2, 332.52, 332.06, 326.8, 320.16, 331.71, 341.5, 348.52, 350.3, 349.35, 347.1, 345.52, 346.67, 345.5, 345.62, 346.88, 346.05, 346.21, 346.53, 346.66, 345.24, 342.27, 340.35, 332.6, 330.73, 336, 338.67, 335.02, 329.42, 331.34, 332.85, 334.43, 334.31, 341, 344.65, 344.3, 342.01, 337.81, 331.9, 330.65, 330.75, 325.51, 325.07, 329.31, 324.88, 318.33, 319.36, 310.5, 315.2, 322.38, 318.12, 325.09, 327.25, 333.44, 331.88, 332.84, 334.2, 342.5, 346.71, 354, 352.2, 352.82, 348.62, 356.38, 356.34, 359.17, 365.28, 373.32, 386, 383.9, 387.75, 389.62, 399.68, 392.15, 388.13, 384, 392.37, 388.35, 382.24, 377.35, 362.57, 353.02, 355, 362.5, 364.72, 374.23, 378.09, 376.06, 378, 361.37, 356, 355.09, 357, 370.6, 365, 370.8, 388, 386.21, 381.86, 380.72, 371.83, 366.48, 382, 382.31, 375.02, 371.9, 380.25, 385.76, 389.9, 395.03, 395.2, 411.19, 412, 396.7, 399.85, 391.3, 398.06, 396.51, 386.21, 381.18, 373.17, 354.24, 360.3, 371.8, 368.49, 378.21, 391.5, 400.14, 402.85, 415.27, 415.94, 415.99, 397.8, 394.21, 390.75, 395.4, 397.38, 393.15, 401.89, 402.51, 401.05, 393.22, 395.11, 395.36, 399.16, 396.13, 401.56, 394.23, 382.15, 380.26, 378.2, 379.45, 384.32, 375.5, 374.88, 365.91, 370.94, 366.88, 363.32, 370.33, 370.2, 378.3, 380.75, 388.58, 390.39, 389.38, 386.76, 390.23, 391.03, 389.45, 387.1, 377.68, 378.31, 379.57, 380.48, 387.26, 392.01, 396.1, 399.49, 403.02, 401.34, 400.51, 403.49, 409, 409.28, 412.67, 419.22, 421.35, 421.5, 419.31, 418.75, 418.66, 422.96, 426.3, 426.51, 419.75, 422.3, 419.55, 443.73, 443.14, 443.77, 445.39, 453.07, 455.55, 453.98, 455.56, 458.2, 464.58, 469.7, 480.56, 488.55, 497.09, 502, 496.89, 486.63, 500.3, 504.12, 509.07, 509.5, 518.64, 516.28, 525.85, 535.7, 538.77, 542.52, 526, 516.22, 523.3, 532.12, 543.11, 547, 555.75, 575.4, 578.55, 578, 589.05, 582, 601.41, 595.53, 594.4, 595.26, 606.06, 610.31, 607.23, 597.94, 600.38, 622.51, 617, 623.4, 625.3, 626, 623.34, 620.5, 603.51, 578.25, 571.91, 602.71, 584.52, 570.42, 556.62, 555, 606, 602.13, 600.5, 583, 581.23, 578.86, 580.3, 565.17, 561.23, 558.73, 560.85, 568.44, 564.35, 557.6, 551.75, 541.04, 530.12, 522.18, 534.05, 552.58, 553.23, 561.23, 558.47, 565.31, 566.56, 571.46, 560.52, 548.5, 558.33, 565.5, 570.5, 569, 570.63, 566.7, 570.38, 567.26, 569.55, 570.37, 583.1, 580.8, 577.44, 575.42, 570.37, 567.33, 571.92, 565.61, 574.25);

$close = array(346.67, 351.99, 353.56, 345.43, 330.01, 334.64, 330.67, 339.3, 341.2, 339.19, 344.97, 351.54, 350.44, 350.96, 348.63, 348.51, 344.56, 341.19, 338.89, 338.04, 338.08, 335.06, 330.8, 332.4, 336.13, 332.42, 327.46, 331.85, 337.86, 342.41, 350.7, 353.01, 350.42, 350.15, 346.75, 350.13, 346.28, 348.2, 349.57, 346.75, 346.66, 347.6, 349.45, 347.23, 346.57, 340.5, 333.3, 336.14, 339.87, 340.53, 335.22, 334.4, 332.19, 336.78, 335, 337.41, 347.83, 345.51, 346.1, 343.44, 338.04, 332.04, 332.24, 331.49, 325.9, 326.6, 332.44, 326.75, 325.16, 320.26, 315.32, 325.3, 322.61, 331.23, 326.35, 332.04, 335.26, 334.04, 335.67, 343.26, 349.43, 351.76, 357.2, 359.71, 354, 353.75, 358.02, 357.77, 364.92, 373.8, 376.85, 386.9, 387.29, 393.3, 398.5, 403.41, 392.59, 391.82, 390.48, 396.75, 388.91, 392.57, 377.37, 373.62, 353.21, 374.01, 363.69, 373.7, 376.99, 383.41, 380.48, 380.44, 366.05, 356.03, 356.44, 373.6, 376.18, 373.72, 383.58, 389.97, 389.99, 384.83, 381.03, 374.05, 379.74, 383.93, 384.14, 377.48, 379.94, 384.62, 389.3, 392.96, 400.5, 411.63, 413.45, 412.14, 401.82, 404.3, 403.17, 399.26, 397.01, 390.57, 381.32, 374.6, 372.5, 378.25, 377.37, 369.8, 388.81, 400.29, 402.19, 408.43, 422, 419.99, 422.24, 398.62, 395.31, 392.87, 405.77, 397.77, 400.6, 404.69, 404.95, 404.78, 396.51, 397.41, 403.07, 400.24, 399.73, 406.23, 395.28, 385.22, 384.62, 379.26, 388.83, 384.77, 377.41, 374.94, 369.01, 376.51, 366.99, 363.57, 376.12, 373.2, 382.2, 387.93, 389.7, 393.01, 390.95, 389.09, 390.66, 393.62, 391.84, 388.81, 380.19, 378.94, 381.02, 382.21, 395.95, 396.45, 398.55, 403.33, 406.53, 402.64, 405.12, 405, 411.23, 413.44, 418.03, 422.4, 421.73, 423.24, 422.55, 421.39, 419.81, 424.7, 429.11, 427.75, 420.3, 427.41, 420.41, 446.66, 444.63, 447.28, 453.01, 456.48, 456.19, 455.12, 459.68, 463.97, 468.83, 476.68, 493.17, 493.42, 502.6, 509.46, 497.67, 502.21, 502.12, 514.85, 513.04, 516.39, 522.41, 525.76, 535.41, 542.44, 544.47, 545.18, 533.16, 530.26, 530.69, 541.99, 545.17, 552, 568.1, 589.58, 585.56, 585.57, 601.1, 605.96, 602.5, 599.34, 596.05, 606.98, 614.48, 617.62, 609.86, 599.55, 618.63, 629.32, 624.31, 633.68, 636.23, 628.44, 626.2, 622.77, 605.23, 580.13, 609.7, 608.34, 587.44, 572.98, 571.7, 560.28, 610, 607.7, 603, 583.98, 582.13, 585.98, 581.82, 565.25, 569.48, 568.18, 569.18, 570.52, 566.71, 558.22, 553.17, 546.08, 530.12, 530.38, 561.28, 556.97, 570.56, 565.32, 562.29, 572.27, 579.17, 577.73, 560.99, 564.29, 562.83, 571.46, 571.72, 580.32, 571.17, 576.16, 572.16, 571.53, 574.13, 585.78, 587.41, 585.74, 577.67, 582.1, 570.77, 572.03, 574.5, 569.05, 584);

$volume = array(18138800, 16824200, 15587600, 25751700, 41312500, 23550700, 26900300, 14621000, 11651100, 13321200, 14453900, 16041800, 11048200, 12603500, 11764400, 9798800, 14952200, 16431500, 17248600, 14376300, 13337300, 13483300, 14255300, 15232400, 12372700, 10785300, 16208300, 21782000, 14977700, 25023400, 26921300, 9519400, 12057200, 12721800, 12899500, 35940800, 15811100, 11198600, 13901700, 12009300, 10008700, 7312500, 10074500, 12002600, 11462700, 11649700, 16076400, 16170900, 11956100, 9327300, 12078200, 13661000, 11502900, 10507900, 7953300, 7273200, 14919100, 19810000, 12103000, 11194300, 16497800, 18927500, 11924500, 9834400, 15504200, 11773400, 11948800, 14264500, 18235300, 21981800, 22880100, 17620500, 13949300, 19991300, 15711600, 12141400, 10510700, 12597000, 11543900, 15546800, 12688300, 15879400, 14273600, 17497300, 15816200, 16128800, 13987000, 15376100, 17302300, 20451000, 29255100, 33618800, 18804100, 18454500, 21064400, 17020700, 23547200, 21214800, 22592200, 21886800, 22840600, 26160800, 31121600, 43020000, 40850100, 38663600, 31380300, 26498700, 18891900, 16447900, 17817400, 15787800, 30408300, 27710000, 19118000, 23458300, 22366700, 31117800, 22909800, 14473300, 14925700, 18669800, 12275800, 15684500, 18203400, 12520500, 14862700, 20181300, 16708200, 15740600, 19097200, 14922000, 24946000, 29423500, 27705300, 21641900, 34588500, 19517200, 29031200, 22589100, 15351800, 23263000, 19579800, 23895500, 44059800, 28088100, 29020700, 19129100, 15804000, 21631400, 22224400, 15220800, 20477300, 24501500, 31485700, 39428200, 19626000, 22187200, 17941200, 15378600, 16296400, 17673300, 11529900, 13772300, 18992400, 11723300, 15768700, 10793800, 9652200, 14301400, 19952900, 26606400, 23349400, 15466500, 15392100, 12471700, 17147100, 13288300, 16007200, 14617700, 15308600, 9098500, 12380100, 13429600, 14502300, 13827800, 13545400, 12763100, 10135800, 10892800, 13441200, 10612200, 10752300, 12112000, 14541200, 9158800, 15056300, 8411700, 12050100, 9390900, 7227000, 9628800, 9472600, 8173400, 7719800, 6420500, 10794900, 9294400, 9688100, 11370900, 14072200, 9225900, 7685400, 7597200, 8077100, 8674800, 9885300, 9347700, 14784600, 10930700, 19558400, 34223600, 11579600, 10710200, 13547400, 13996800, 9644300, 6671200, 10245200, 8917200, 11293600, 14567000, 31579000, 22546400, 18471600, 16497500, 53789700, 33733900, 19135300, 21628000, 17260500, 20286600, 14831400, 19556400, 21442300, 34000000, 24401800, 15418200, 28897100, 28937000, 28501300, 18444300, 14960600, 14545700, 24673200, 50672800, 41416800, 29481600, 32186900, 29166700, 23001400, 22290400, 15374500, 21276300, 21683100, 23409200, 21722700, 26108400, 21369400, 29805400, 20463500, 22902700, 21340500, 31774600, 24878900, 21940300, 30701500, 37528000, 36624400, 34090300, 29811100, 36820500, 34518400, 38442800, 32346800, 19145100, 14527500, 18076400, 21821300, 15272200, 13948100, 18988500, 16551800, 17941000, 17167900, 12179900, 14269400, 12771600, 17010900, 20031900, 25614900, 26153100, 22538900, 24813800, 20889100, 17721300, 11730900, 13589400, 18907800, 17568200, 18606400, 19892400, 13864700, 14325100, 13565300, 12395200, 21116500, 15556400, 10491800, 12351400, 11973300, 15728900, 12907200, 12827000, 11660800, 10169400, 10869800, 9883900, 7252100, 10108600, 15051400);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-08-02 18:55 UTC] ab@php.net
trader_adosc you mean? Strangely i have some output here. What time periods are 
you using? Cause the oscillator needs some forerun to accumulate.

You might also find this page useful http://tadoc.org/
 [2012-08-02 19:05 UTC] mike at saymikeo dot com
-Status: Open +Status: Closed
 [2012-08-02 19:05 UTC] mike at saymikeo dot com
I was putting in the same number for the fast and slow. Sorry for the confusion. 
Thanks for that documentation.
 [2012-08-03 08:05 UTC] ab@php.net
Yep, it subtracts two MAs ) . I'll make a test from the data anyway if you don't 
mind.

Btw, could you please check the bug #62652 if it's fixed with trader 0.2.2?
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 15:01:48 2019 UTC