thanks Josh i elaborate better my problem:
I want to use recalclastbarafter to obtain a market entry near the session end time.
In order to do that my first idea was to
- 1) Check if the currenttime is 5 minute before the session close time.
2) if this condition is true then start to recalc every 5 seconds, and eventually send the order.
Unfortunately i did't find a way to perferform the point N 1 in a 1 Day timeframe because if i start the signal calculation before 15:55 something like
Code: Select all
var: time_trigger(1555);
condition1 = currenttime >= time_trigger;
never returns a "True" value.
And also TJ says that recalclastbarafer cannot be subsequent to a condition and it has to be applyed to the entire script.
So the logical consequence of that is to follow the example of the help
https://www.multicharts.com/trading-sof ... stBarAfter page and start the recalc in the last bar and of course it works, infact it re-calculate the entire script every 5 seconds, and it has no problem to perform the time_trigger condition,
unfortunately the Bar prices HLCV are recalculated as well, and also all the indicators of course, so the calculation of the conditions that makes the script to buy or sell are now based on a number of intraday data that should not be considered.
So basically i end up by having a true 1 Day Timeframe until yesterday and a 5 minute timeframe for today.
So the next step that comes into my mind is to start the recalc last bar in the Last Bar of the Chart as in the Help page example, and put a number of seconds corresponding to [( start time - close time) - 5 minutes] as parameter, but it seems a quite huge number of seconds and a no so linear solution.
Right now i'm stuck at this point of having a market entry just before the close time, and i am considering of customizing the sessions make them close 5 minutes before the RTH close time.