Suppose you have a Forex Tester's strategy, and within your strategy, you wish to selectively taking signal through a dialog box, i.e., when a trigger signal is registered, you would choose between taking and skipping that signal.
You would take the signal if the market condition is right, otherwise skip the trigger signal.
Here's sample codes to implement user's selection. I have tested it on FT, my compiler is Lazarus.
library PoppingUpDialogue;
uses
Interfaces, // for LCL in Lazarus Compiler
Windows, // for MessageBox
StrategyInterfaceUnit // for Print
;
{-----Init strategy----------------------------------------------------------}
procedure InitStrategy; stdcall;
begin
end;
{-----Done strategy----------------------------------------------------------}
procedure DoneStrategy; stdcall;
begin
end;
{-----Reset strategy---------------------------------------------------------}
procedure ResetStrategy; stdcall;
begin
//
end;
{-----Process single tick----------------------------------------------------}
procedure GetSingleTick; stdcall;
var
temp: Word;
begin
Pause;
temp := MessageBox(0, PChar('Do you want to do something?'), PChar('Think please '), MB_YESNO+MB_ICONQUESTION);
Pause;
if (temp = IDYES) then Print('Do something!');
if (temp = IDNO) then Print('Do NOTHING!');
Pause;
end;
exports
InitStrategy, DoneStrategy,
ResetStrategy,
GetSingleTick;
end.
How to use Delphi's Dialog box in a Strategy
-
- Posts: 1
- Joined: Sun Dec 22, 2013 9:19 pm
How to use Delphi's Dialog box in a Strategy
Kind Regards,
Hendiyes
Hendiyes
Return to “Programming lessons”
Who is online
Users browsing this forum: No registered users and 24 guests