Special thanks to “George Soros” (Matt Briand) for the original example.
Note: you have to add a timestamp at the end of every signal in the following format - yyyymmddhhmm0 format (note the 0 at the end)
Tradestation example (2000i and Tradestation 6) :
Example of an EasyLangage statement :
if condition1 then
print (file("C:\Trading.txt"), "place,BUY,1,STPLMT" + "," + numtostr(buystp +1,25)+"," + numtostr(buystp,2))
else if condition2 then
print (file("C:\Trading.txt"),"cancel,,,,0");
The if else if structure forces Tradestation to have only one condition true at a time so that more than one line is not printed to the text file per cycle.
However, one could probably program it to handle any number of command lines from Tradestation.
Bracket Trader only considers one line of the text file per Tradestation cycle.