portfolio trader code help
Posted: Jul 30 2015
Hi, i am working with portfolio trader on daily data with SPY as instrument and this code as signal:
what happens is that if i turn on the strategy automation when the codition is already met it works, and it prints "OK start calculation" every 5 seconds.
But if i turn on the strategy when the time condition is not met, and i wait for the currenttime to be greather than the trigger time it won't print anything even when the time condition is met.
I am doing this to breakdown the problem of using recalclastbarafter to obtain a market entry as near to the close price as possible and i don't want to modify the session duration.
Thank you
Code: Select all
var: time_trigger(2257.00) {put it one minute after the current time to test the code}
if currenttime >= time_trigger and currenttime < sessionendtime(1,1) then
begin
RecalcLastBarAfter(5);
Print( "OK start calculation")
end
else
Print ("do not calculate");
But if i turn on the strategy when the time condition is not met, and i wait for the currenttime to be greather than the trigger time it won't print anything even when the time condition is met.
I am doing this to breakdown the problem of using recalclastbarafter to obtain a market entry as near to the close price as possible and i don't want to modify the session duration.
Thank you