{ ***** pr0t v1.0 ***** }

external: "c:\Program Files\TradeStation\Program\pr0t.dll", int, "pr0tinit", IEasyLanguageObject;
external: "c:\Program Files\TradeStation\Program\pr0t.dll", int, "pr0tdone", IEasyLanguageObject;

{exported functions: you should obviously rename them in order to obfuscate your source }
{and it's also a good idea to implement additional license checks inside some of them.  }
external method: "c:\Program Files\TradeStation\Program\pr0t.dll", double, "myClose", int;
external method: "c:\Program Files\TradeStation\Program\pr0t.dll", double, "myOpen", int;
external method: "c:\Program Files\TradeStation\Program\pr0t.dll", double, "myHigh", int;
external method: "c:\Program Files\TradeStation\Program\pr0t.dll", double, "myLow", int;
external method: "c:\Program Files\TradeStation\Program\pr0t.dll", double, "myTrueHigh", int, int;
external method: "c:\Program Files\TradeStation\Program\pr0t.dll", double, "myTrueLow", int, int;
external method: "c:\Program Files\TradeStation\Program\pr0t.dll", double, "myTrueRange", int, int;
external method: "c:\Program Files\TradeStation\Program\pr0t.dll", double, "myTime";
external method: "c:\Program Files\TradeStation\Program\pr0t.dll", int, "myDayOfWeek";

{ Get the state of precoded condition (ConditionNumber, Argument), returns TRUE or FALSE }
external method: "c:\Program Files\TradeStation\Program\pr0t.dll", BOOL, "Cond", int, int;

{ Check License (License Info, Customer ID)  Output: error code }
external method: "c:\Program Files\TradeStation\Program\pr0t.dll", double, "chkLicense", string, int;

#Events
	OnCreate 	= pr0tinit;
	OnDestroy	= pr0tdone; 
#End

{ ****************************************** }

Vars: myVar1(0), myVar2(0);

begin

if chkLicense("my license key 1234", CustomerID) = 45091313 then 
begin

{ Test corresponding conditions to behave properly: }
		
        myVar1 = 7;
	myVar2 = 7;

	if Cond(1,0) <> (myVar1 > myVar2 - 1) then 
		print("condition 1 error"); 
	if Cond(2,0) <> (Time = 1300) then 
		print("condition 2 error"); 
	if Cond(3,5) <> (DayOfWeek(D) = 5) then 
		print("condition 3 error"); 

end;


{ ** program end **}
end;


