Function to get separate exec timing space in Start

Post Reply
User avatar
scanner
Trader
Posts: 20
Joined: Mon Jul 16, 2012 2:32 am

Function to get separate exec timing space in Start

Post by scanner »

Adaptation of classical System newbar to set it one time at the beginning of a code and to be able to fill fields with new function to be executed each moment you want with Array.

objectif is to set free the cpu console to get new tick as quick as possible, itself is updating every minute , and your function only one time at the moment you want .

Just copy each part in your code :

- Variable in global scope
- exec function(); in init and start

- body functions() with yours

- and then separte part in start body. be carrefull about } of course, all of them are inside the others, so,
all the close one are at the end of start function }}}}}

Tell me if level of that can help or if it is too much "basic" for you :)
You do not have the required permissions to view the files attached to this post.
dietcoke
Trader
Posts: 162
Joined: Tue Nov 15, 2011 9:59 pm

Re: Function to get separate exec timing space in Start

Post by dietcoke »

scanner wrote:Adaptation of classical System newbar to set it one time at the beginning of a code and to be able to fill fields with new function to be executed each moment you want with Array.

objectif is to set free the cpu console to get new tick as quick as possible, itself is updating every minute , and your function only one time at the moment you want .

Just copy each part in your code :

- Variable in global scope
- exec function(); in init and start

- body functions() with yours

- and then separte part in start body. be carrefull about } of course, all of them are inside the others, so,
all the close one are at the end of start function }}}}}

Tell me if level of that can help or if it is too much "basic" for you :)

Hi Scanner,

Thanks for your contributions, please keep them coming. You have a nice consistent programming style.

Processing only on a NewBar is definitely something many of us recognise as necesary to reduce cpu overhead and you will find a number of different implementations of this in various EA's on this site.

I think the best way to deal with newbar is to write it as a library function that way it can just be built into your EAas a function call.

eg if(NewBar(Symbol(),PERIOD_M5)) Do stuff
Image
User avatar
scanner
Trader
Posts: 20
Joined: Mon Jul 16, 2012 2:32 am

Re: Function to get separate exec timing space in Start

Post by scanner »

Hi dietcoke and Apologyze for so much time between your answer and mine due to some personnals problems.
So, thanks for your answer, in fact, I don't know how to make a library function, mine are built inside "Include" , and I call these functions in Ea or indicator.
Post Reply

Return to “Coders Hangout”