Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

theman

Help in Converting a Simple EasyLanuage Code to Nina

Recommended Posts

Hi there

 

Wonder if you guys can help?

 

I found this code in google, can someone please help me in translating it to NinjaTrader (pref working with Ninja 7 as well?)

 

Hope this is OK?

 

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

 

Inputs: Sens(3), Mult(2);

Variables: Variable1(1), Variable2(18), Variable3(0), Variable4(9999999);

Variables: Variable5(9999999), Variable6(9999999), Variable7(0), Variable8(0);

Variables: Variable9(0), Variable10(0), Variable11(0), Variable12(0);

 

Variable1 = Sens ;

Variable2 = 18+Sens*Variable1 ;

Variable3 = JCAVR (Mult) ;

Variable7 = AVERAGE (CLOSE, 9) ;

Variable8 = AVERAGE (CLOSE, Variable2) ;

 

IF true THEN

BEGIN

IF HIGH-LOW = 0 THEN Variable9 = AVERAGE (ABSVALUE (CLOSE-CLOSE[3]), 10) ELSE Variable9 = AVERAGE (RANGE, 10) ;

 

IF LOW-Variable10 > Variable3*1*(1*RECIPROCAL (BIGPOINTVALUE)) THEN Variable10 = LOW-(1+0.1*Sens)*Variable9 ;

IF Variable6-HIGH > Variable3*1*(1*RECIPROCAL (BIGPOINTVALUE)) THEN Variable6 = HIGH+(1+0.1*Sens)*Variable9 ;

 

IF Variable7[1] < Variable8[1] AND Variable7 > Variable8 THEN Variable10 = TrueLow-Variable9 ;

IF Variable7[1] > Variable8[1] AND Variable7 < Variable8 THEN Variable6 = TrueHigh+Variable9 ;

 

IF MRO (Variable7 >= Variable8, 2, 2) >-1 AND Variable10 <= Variable10[1] THEN Variable10 = Variable10[1] ;

IF MRO (Variable7 <= Variable8, 2, 2) >-1 AND Variable6 >= Variable6[1] THEN Variable6 = Variable6[1] ;

Variable11 = MAXLIST (CLOSE[1]-AVGTRUERANGE (5)*3, IFF (CLOSE[1] < Variable11[1], 0, Variable11[1])) ;

Variable12 = MINLIST (CLOSE[1]+AVGTRUERANGE (5)*3, IFF (CLOSE[1] > Variable12[1], CLOSE*2, Variable12[1])) ;

IF Variable7[1] < Variable8[1] THEN Variable10 = MAXLIST (LOW-Variable11, Variable10) ;

IF Variable7[1] > Variable8[1] THEN Variable6 = maxLIST (Variable12-HIGH, Variable6) ;

IF Variable7 >= Variable8 AND Variable10 <= HIGH THEN PLOT1 (Variable10, "BuyStop") ;

IF Variable6 > 0 AND Variable6 < 1000000000 AND Variable7 <= Variable8 AND Variable6 >= LOW THEN PLOT2 (Variable6, "SellStop") ;

END ;

 

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

 

This is the JCAVR function

 

Inputs: Mult(NUMERIC);

 

JCAVR = Mult*AVERAGE (RANGE, 10)*BIGPOINTVALUE ;

 

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Share this post


Link to post
Share on other sites

1st step.... put the code in the code box.

 

that's the # icon in the Message window.

 

 

2nd step... add some description,

 

3rd step... include a chart...

 

4th step... the most important... tell us what or why this indicator is interesting/useful....

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.