|
|
-
Strategy Parameters and QTXT/Comment
Hi,
Had a couple of clarifications:
a) Is it possible to see the QTXT/Comments column in TradeStation.
b) Does change in Parameters of a Strategy, does a restart of strategy - ie all global LUA variables getting reset, or there is no restart.
Thanks in advance.
Regards
Anka Software
-
Hello,
 Originally Posted by AnkaSoftware
a) Is it possible to see the QTXT/Comments column in TradeStation.
It is not displayed in TradingStation. But you can print this text to display it in the Events window (Alerts and Trading Automation -> Show Events).
 Originally Posted by AnkaSoftware
b) Does change in Parameters of a Strategy, does a restart of strategy - ie all global LUA variables getting reset, or there is no restart.
If you change some strategy parameter, the strategy will be restarted. But you can use the method ChangeParameters() to change the parameters "on the fly" without the restarting of the strategy instance. For details please see ChangeParameters()
I hope this will help.
-
Natalya,
Thanks for the replies.
Another query. In a strategy, I place a LE order, and want to wait till the entry appears in the 'Orders' table.
As per the example given in FXCodeBase.COM: Forex Chart Indicators and Development • Search, I wait for the call to function "ExtAsyncOperationFinished", and do the check core.host:execute("isTableFilled", "orders").
However this 'wait' for the LE order to appear in the 'Orders' (or Trades) table is not working Please advice.
Thanks in advance.
-
Please make sure that you have included helper lua in your strategy code:
Code:
dofile(core.app_path() .. "\\strategies\\standard\\include\\helper.lua");
If this won't help, could you please provide code snippet how do you 'wait' for the order to appear in the table.
-
Natalya,
I have included the line regarding the code in my strategy.
Code for waiting for order to execute (taken from samples in the manual) is as follows:
Code:
execute;
function ExtUpdate(id, source, period) -- The method called every time when a new bid or ask price appears.
-- Wait for asynchronous ie orders operations to finish
if executing then
core.host:trace("Executing Returning ");
return ;
end
if (not checkReady("Trades")) or (not checkReady("Orders")) or (not checkReady("Offers") or (not checkReady("Closed Trades"))) then
core.host:trace("Table filled Returning ");
return false;
end
...
enterOrders()
...
...
end
function ExtAsyncOperationFinished(cookie, successful, message)
if cookie == 100 then
executing = false;
if not successful then
assert(successful, message);
return;
end
end
end
function checkReady(table)
local rc;
if Account == "TESTACC_ID" then
-- run under debugger/simulator
rc = true;
else
rc = core.host:execute("isTableFilled", table) && core.host:execute("isReady", table);
end
return rc;
end
function enterOrders()
...
...
...
executing = true;
success, msg = terminal:execute(100, valuemap);
if not(success) then
executing = false;
terminal:alertMessage(instance.bid:instrument(), instance.bid[instance.bid:size() - 1], "alert_ExitOrderFailed" .. msg, instance.bid:date(instance.bid:size() - 1));
end
end
dofile(core.app_path() .. "\\strategies\\standard\\include\\helper.lua");
-
Thank you for the response.
Looks like there are no issues in the code. This should work. But I have forwarded it to developers to get the confirmation from them. I will let you know about results.
-
Natalya,
Will await for your response on ExtAsyncOperationFinished.
Going back to earlier query on Strategy restarts, is there any way to save internal variables of Strategy across two 'sessions', something similar to MT4 global variables?
-
 Originally Posted by AnkaSoftware
Code:
...
rc = core.host:execute("isTableFilled", table) && core.host:execute("isReady", table);
...
Is it a misprint on the forum or this string from your strategy?
It should be rc = core.host:execute("isTableFilled", table) and core.host:execute("isReady", table);
-
 Originally Posted by AnkaSoftware
Natalya,
Will await for your response on ExtAsyncOperationFinished.
Going back to earlier query on Strategy restarts, is there any way to save internal variables of Strategy across two 'sessions', something similar to MT4 global variables?
You can use Persistent Storage (Example)
-
Thanks Sibvic.
After incorporating the storagedb related code, I got an error on missing files, when I tried to load strategy into Marketscope demo account.. I have copied the storagedb.dll from \IndicoreSDKt folder to FXTS2 folder. Any other files required apart? I am still getting others when I try to use storagedb.
-
Please refer to this thread to see how to resolve the problem:
FXCM TSII Version 01.11.111711 StorageDB problem
I do appologize for the inconvenience.
-
Natalya,
Thanks.
a) Any update on the ExtAsyncOperationFinished query?
b) I am getting occasional errors "The Entry,Stop or Limit price you are entering is incorrect .. " in the Strategy. I have a check that the Entry price is more than 1 pip away from market price, else I go for OM orders. Any other checks to be added / sample code for same available?
-
 Originally Posted by AnkaSoftware
a) Any update on the ExtAsyncOperationFinished query?
I'm afraid we couldn't re-create the issue. Could you please provide the full code of the strategy? If it is not for public, you can send it to e-mail: support (at) gehtsoftusa dot com.
 Originally Posted by AnkaSoftware
b) I am getting occasional errors "The Entry,Stop or Limit price you are entering is incorrect .. " in the Strategy. I have a check that the Entry price is more than 1 pip away from market price, else I go for OM orders. Any other checks to be added / sample code for same available?
If you use peg orders, you should pass the order price in pips (for example, 50 pips, do not use converted values such as 0.0050).
Such an error can also occur on ranging market when the price is changed fast. So if the price of your order is close to the market price, it may become invalid while sending the request for execution.
Last edited by Natalya; 01-25-2012 at 06:15 AM.
Reason: a typo corrected
-
a) ExtAsyncOperationFinished
Will send the code sample to reproduce the problem shortly
b) Error "The Entry,Stop or Limit price you are entering is incorrect .. "
I am using Stop Order for an existing position with the Rate specified and TrailUpdatePips set to 1. Any way to suppress the errors/warning and not to let Strategy to stop?
-
Another question - How do I find out, if a Stop is attached to a trade, all Trade row parameters viz, Stop, StopOrderID etc return <blank> or nil values?
|