Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 831 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Previous bar not saving on series in Live Price feed #481493
09/21/20 18:51
09/21/20 18:51
Joined: Apr 2019
Posts: 48
Albay
M
marr Offline OP
Newbie
marr  Offline OP
Newbie
M

Joined: Apr 2019
Posts: 48
Albay
I am trying to print the previous bar of high and low using with this snippet
```
BarPeriod = 1;

TimeFrame = frameSync(M1);
vars highSmall = series(priceHigh());
vars lowSmall = series(priceLow());

printf("\nhighSmall[1] %.8f", highSmall[1]);
printf("\nhighSmall[0] %.8f", highSmall[0]);
```

but whenever a minute passed the value of highSmall[1] and lowSmall[1] is always 0 while the highSmall[0] and lowSmall[0] updates as expected.

How do I solve this prob? does live price feed doesn't store on series?

Re: Previous bar not saving on series in Live Price feed [Re: marr] #481498
09/21/20 20:49
09/21/20 20:49
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
You might've created a framing problem. Can you post the entire code? What is the definition of "M1"?

Re: Previous bar not saving on series in Live Price feed [Re: AndrewAMD] #481521
09/24/20 16:59
09/24/20 16:59
Joined: Apr 2019
Posts: 48
Albay
M
marr Offline OP
Newbie
marr  Offline OP
Newbie
M

Joined: Apr 2019
Posts: 48
Albay
#define M1 (1/BarPeriod)
#define M5 (5/BarPeriod)
#define M30 (30/BarPeriod)

and

TimeFrame = frameSync(M1 );
...

Re: Previous bar not saving on series in Live Price feed [Re: marr] #481522
09/24/20 18:33
09/24/20 18:33
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Where's the rest of your code?

Re: Previous bar not saving on series in Live Price feed [Re: marr] #481523
09/24/20 18:42
09/24/20 18:42
Joined: Apr 2019
Posts: 48
Albay
M
marr Offline OP
Newbie
marr  Offline OP
Newbie
M

Joined: Apr 2019
Posts: 48
Albay
Here is the complete code:

#define ASSET_LIST "AssetsFix"
#define M1 (1/BarPeriod)
#define M5 (5/BarPeriod)
#define M30 (30/BarPeriod)

function run() {
set(LOGFILE|PLOTNOW);
setf(PlotMode,PL_FINE);
assetList(strf("%s.csv", ASSET_LIST));
BarPeriod = 1;

// Load the prices on 1 minute timeframe
TimeFrame = frameSync(M1);
vars highSmall = series(priceHigh());
vars lowSmall = series(priceLow());

// Load the prices on 5 minute timeframe
TimeFrame = frameSync(M5);
vars highMedium = series(priceHigh());
vars lowMedium = series(priceLow());

TimeFrame = frameSync(M30);
vars highLarge = series(priceHigh());
vars lowLarge = series(priceLow());

printf("\nhighSmall[1] %.8f", highSmall[1]);
printf("\nhighSmall[0] %.8f", highSmall[0]);
printf("\nlowSmall[1] %.8f", lowSmall[1]);
printf("\nlowSmall[0] %.8f", lowSmall[0]);


}

btw, I am planning to use sec barperiod but the result is the same previous high and low doesn't update only the current when using timeframe, while it works properly if i printed the using priceHigh(1) or priceLow(1)

Re: Previous bar not saving on series in Live Price feed [Re: marr] #481577
09/30/20 19:43
09/30/20 19:43
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Originally Posted by marr
but whenever a minute passed the value of highSmall[1] and lowSmall[1] is always 0 while the highSmall[0] and lowSmall[0] updates as expected.
I cannot repeat this behavior with your most recent code sample. No problems detected.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1