DMI signal little help in coding needed

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
Tresor
Posts: 1104
Joined: 29 Mar 2008
Has thanked: 12 times
Been thanked: 51 times

DMI signal little help in coding needed

Postby Tresor » 02 Jun 2008

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
Attachments
DMI.jpg
DMI.jpg (94.89 KiB) Viewed 423 times

khalaad
Posts: 310
Joined: 07 Jan 2007
Location: Lahore, Pakistan
Has thanked: 62 times
Been thanked: 57 times

DMI Cross

Postby khalaad » 07 Jun 2008

Tresor,

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

Good luck,

Regards,
Khalid

khalaad
Posts: 310
Joined: 07 Jan 2007
Location: Lahore, Pakistan
Has thanked: 62 times
Been thanked: 57 times

Postby khalaad » 07 Jun 2008

Sorry!

I cannot understand why the file did not attach.

Here is another try.

Khalid

khalaad
Posts: 310
Joined: 07 Jan 2007
Location: Lahore, Pakistan
Has thanked: 62 times
Been thanked: 57 times

DMI Cross

Postby khalaad » 07 Jun 2008

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

Tresor
Posts: 1104
Joined: 29 Mar 2008
Has thanked: 12 times
Been thanked: 51 times

Postby Tresor » 07 Jun 2008

Many thanks. Works perfectly.

Regards

Tresor
Posts: 1104
Joined: 29 Mar 2008
Has thanked: 12 times
Been thanked: 51 times

Postby Tresor » 07 Jun 2008

TS guys,

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

Regards


Return to “User Contributed Studies and Indicator Library”