Continue script between timeframes

 

Hi All,

I am running a script in contnuous mode using a 'while' loop.

int start()
{
  //initialise for other objects already existing
  objectstotal = ObjectsTotal();
  
  while(IsStopped()==False)
   {
    ...code here

   }
}

This works fine while in one timeframe.

At the moment a message box appears asking if I want to stop the script when I move between timeframes. I can do this and just reload the script but it would be ice to somehow keep the script running.

Can anybody suggest how to keep the script running when I change timeframes?

thanks

 

Describing his selection to make the N.H.L., Jirik told the Czech author Karel Knap: Today, I will not practice it. Then again, Irealised i was homesick.
[url=http://www.nfl2008jerseys.com/]nfl jersey[/url]
 
741852:

Describing his selection to make the N.H.L., Jirik told the Czech author Karel Knap: Today, I will not practice it. Then again, Irealised i was homesick.
 
sd59:
At the moment a message box appears asking if I want to stop the script when I move between timeframes.
Do you have a sleep in the loop one second or less?
 
WHRoeder:
Do you have a sleep in the loop one second or less?

I don't but I have just tried it with Sleep(300) and no difference. I somehow need to fool it into not responding when I change timeframes but this might be inherently built in and automatically ceases the loop which is what is happening.
 

hey guys, back to this old chestnut...!

Does anybody have any idea how to keep a script going when moving between timeframes?

I am running a continuous script - when i change timeframes a 'system' message appears asking me if i want to stop running the script - if choose 'No' then no problem - if I choose 'Yes' it terminates the script.

Is there a way of keeping the script running?

thanks

 
sd59:
Does anybody have any idea how to keep a script going when moving between timeframes?
Change it to a EA.
 
WHRoeder:
Change it to a EA.

thanks for the reply but the reason i have coded it as a script is so i can use it (for analysis) when the market is closed i.e i don't have to wait for incoming ticks.
 
sd59:

thanks for the reply but the reason i have coded it as a script is so i can use it (for analysis) when the market is closed i.e i don't have to wait for incoming ticks.
Make it into an EA and use the Strategy Tester . . .
 
RaptorUK:
Make it into an EA and use the Strategy Tester . . .


I have a continuously running script that gives me support and resistance levels when I put a horizontal line on a chart. If I move the line up and down the chart it gives me a read out of various s/r levels. When I change timeframe the script is forced to stop running.

I can't really use this on the strategy tester - this is for real-time monitoring of the market.

 

Change it to an EA and get rid of the loop. The EA will be displaying the last tick data.

  1. There are no ticks when the market is closed. Run the tester in VISUAL MODE to end of history and it will display the current status. No coding needed.
  2. If you want to have the EA update when the market is closed and you switch pairs/TF, then have init() queue a tick to force start().
Reason: