Page 1 of 1

DMI signal little help in coding needed

Posted: 02 Jun 2008
by Tresor
Hello,

Could a kind soul help me to write the below code so that MC could compile this reversal signal:

If DMIMinus crosses_above DMIPlus Then Sell This Bar on Close;
If DMIPlus crosses_below DMIMinus Then Buy This Bar on Close;

The idea that I have in my mind is shown in the attachement.

Many thanks in advance

Regards

DMI Cross

Posted: 07 Jun 2008
by khalaad
Tresor,

Please find attached the ready-for-import DMI_cross signal.

Good luck,

Regards,
Khalid

Posted: 07 Jun 2008
by khalaad
Sorry!

I cannot understand why the file did not attach.

Here is another try.

Khalid

DMI Cross

Posted: 07 Jun 2008
by khalaad
ANOTHER FAILURE!!

NEVER MIND. HERE IS THE CODE:

Code: Select all

Inputs: DMIPlusLength( 14 ), DMIMinusLength( 14 ) ;
Variables: var0( 0 ), var1( 0 ) ;

var0 = DMIPlus( DMIPlusLength ) ;
var1 = DMIMinus( DMIMinusLength ) ;

Condition1 = CurrentBar > 1 and var0 crosses under var1 ;
Condition2 = CurrentBar > 1 and var1 crosses under var0 ;

If Condition1 then
Sell Short ( "DMIsell" ) next bar at market ;
If Condition2 then
Buy ( "DMIbuy" ) next bar at market ;
JUST

1. CREATE A NEW SIGNAL
2. PASTE THE CODE
3. AND COMPILE

Posted: 07 Jun 2008
by Tresor
Many thanks. Works perfectly.

Regards

Posted: 07 Jun 2008
by Tresor
TS guys,

Could you make it possible in this forum to attach pla files?

Regards