[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GlobPro DLL examples



PureBytes Links

Trading Reference Links

Hi everyone

         Since there seems to be a lot interest here are a couple of very
simple examples.   You can do a lot more complex system include type things.
Note these won't run with out the DLL.  

                  Pete

First is an alert indicator.   With the defaults nothing happens.  You put in
a price for upper stop or lower stop, and then it plots a line at the price
and alerts when the price is hit.  It will only alert once per bar even with
update every tick on.  The variable GVM is so you can apply it to different
charts.  Must be different for each one.

******************************************************************************
**************

{
Stop Alert Indicator - Sounds alert only once per forming bar.



}

Input: StopHi(99999),StopLo(0),gvm(100);

DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Clear_TS_Data";
DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Save_TS_Data",LONG,FLOAT;
DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Load_TS_Data",LONG,LPFLOAT;
DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Zero_TS_Data",LONG,LONG;

Vars: CurrBarNum(0), AlertFlag(0);
{
At beginning of each new bar number, clear the AlertFlag to allow for another
alert
}

Load_TS_Data( 1+GVM, &CurrBarNum );   { Load value of CurrBarNum from Global
Array }
IF CurrentBar <> CurrBarNum Then
   BEGIN  { Beginning of new bar detected }
      CurrBarNum = CurrentBar;
      AlertFlag = 0;
      { Save new values to Global Array }
      Save_TS_Data( 1+GVM, CurrBarNum );
      Save_TS_Data( 2+GVM, AlertFlag );
   END;


If Stophi < 99999 then begin
Plot1(StopHi,"Stop High");
end;
If stoplo > 0 then begin
Plot2(StopLo,"Stop Low");
end;

Load_TS_Data( 2+GVM, &AlertFlag );   { Load value of AlertFlag from Global
Array }

{ Alert user if current tick is above StopHi or below StopLo 
  Alert only ONCE per forming bar }
If CheckAlert AND AlertFlag=0  then 
      IF C > StopHi- (minmove/pricescale) OR C < StopLo+(minmove/pricescale)
Then
         Begin
            Alert=TRUE;	 {Intrabar stop hit }
            AlertFlag = 1;
         End;

IF AlertFlag = 1 Then Save_TS_Data( 2+GVM, AlertFlag );  { Save new value to
Global Array }

******************************************************************************
************

This next indicator generates a simple stop on say a 30 min chart and just
stores the value.   Same rule about GVM.   This indicator and plotting
indicator use same value, but to use it more than once you would change it.

******************************************************************************
***************

Input:  Dist(3),gvm(0);
Vars: Upper(0),lower(0);

DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Clear_TS_Data";
DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Save_TS_Data",LONG,FLOAT;
DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Load_TS_Data",LONG,LPFLOAT;
DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Zero_TS_Data",LONG,LONG;
;


Upper = high+(dist*(minmove/pricescale));
Lower = low-(dist*(minmove/pricescale));

  { Save new values to Global Array }
      Save_TS_Data( 1+GVM, upper );
      Save_TS_Data( 2+GVM, lower );



plot1(upper,"Buy Stop");
plot2(lower,"Sell stop");

******************************************************************************
**************

The next indicator just plots what you stored in the one above.   Note that if
you chart you ran the above on was a 30 minute, you can run the one below on
anything from any time frame to any tick chart even including a 1 tick chart.

******************************************************************************
****************

Input: gvm(0);
Vars: Upper(0),lower(0);

DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Clear_TS_Data";
DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Save_TS_Data",LONG,FLOAT;
DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Load_TS_Data",LONG,LPFLOAT;
DefineDLLFunc: "c:\omega\prog\globpro.dll",BOOL,"Zero_TS_Data",LONG,LONG;

 { Load value of StopValue from Global Array }



      Load_TS_Data( 1+GVM, &upper );
      Load_TS_Data( 2+GVM, &lower );


plot1(upper,"Buy Stop");
plot2(lower,"Sell stop");


******************************************************************************
******8