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.

77trader

Members
  • Content Count

    6
  • Joined

  • Last visited

Personal Information

  • First Name
    ron
  • Last Name
    goodman
  • Country
    United States

Trading Information

  • Vendor
    No
  1. Enclosed is A correct Think Or Swim (black back round) version of this TrendLine and a very close to correct Amibroker version. The Amibroker Code used is: _SECTION_BEGIN("Bar Chart"); Color = ParamColor("Up Bar", colorGreen ); Color1 = ParamColor("Down Bar", colorRed ); Plot(C,"", IIf(C>O,color,color1), styleBar); _SECTION_END(); _SECTION_BEGIN("MA"); MA100 = MA(Close, 100); Ref0 = Ref(MA100, 0); Ref1 = Ref(MA100, -1); Ref2 = Ref(MA100, -2);
  2. Ron,

     

    This is the code for your 1st part where you have lines and dots and bars instead of candles. It is the translation of your posted ThinkOrSwim code to AFL.

     

    MA100 = MA(Close, 100);

    Ref0 = Ref(MA100, 0);

    Ref1 = Ref(MA100, -1);

     

    Plot(Close, "", colorBlack, styleBar);

    Plot(MA100, "", IIf(Ref0 > Ref1, colorGreen, IIf(Ref0 < Ref1, colorRed, colorBlack)), styleLine | styleDots | styleThick);

     

    Show me the ThinkOrSwim code for your 2nd and I'll try to translate it.

     

    Steve

  3. Hi Steve,

    I trust that my last post didn't take the wind out of your sails.... Your efforts were most appreciated..

    I was able to write the 100MA Trend Line for Think Or Swim, which I posted, but can't convert it into AFL code... hence my cry for 'Help!' It works really well as a swing trade indicator.

    If you still have any energy left for this project, or any pointers for me, I would really appreciate it.

    Best regards,

    Ron

  4. Thanks Steve for your efforts, but you wrote code for candle sticks and this is not what I needed. Please re-read my original post/request. I have enclosed an example that I did in Photoshop. I want a 100MA TREND LINE that changes colors as to the above stated parameters. Thanks again for all your help! -Ron
  5. Thanks again Steve, But I don't this is not what I want. Please read my 1st post and look at the enclosed example that I made in Photoshop. I want a 100MA TRENDLINE that changes colors, (with my parameters above). I will use it as one on my indicators. Again ... Thanks for your help! Ron
  6. Thanks for your initial try...Steve! The colorBlack shows up as a separate line and the 100MA seemed to be only green. I tried it this way (below), close but no cigar... I await your next suggestion.... -Ron A = (Close)/100; MA100 = MA(Close, 100); // SetBarFillColor(IIf(C > MA100, colorGreen, IIf(C < MA100, colorRed, colorBlack))); Plot(MA100, "", IIf(C > MA100, colorGreen, IIf(C < MA100, colorRed, colorBlack)), styleLine | styleThick); _SECTION_END();
  7. I have the correct code to do this in Think Or Swim (see below), but can't seem to write it for Amibroker..... Think Or Swim # Calculate and plot Smooth Moving Average (MA100) plot MA100 = Average(close, 100); MA100.SetPaintingStrategy(PaintingStrategy.Line); MA100.SetLineWeight(1); MA100.DefineColor("Up", Color.green); MA100.DefineColor("Down", Color.red); MA100.DefineColor("Flat", Color.gray); MA100.AssignValueColor(if MA100[0] > MA100[1] then MA100.color("Up") else if MA100[0] < MA100[1] then MA100.color("Down") else MA100.color("Flat"));
  8. I would REALLY appreciate it if someone would help me with writing the AMIBROKER CODE for a simple 100MA, which indicated swings/ trends using the following parameters: • Simple 100 bar moving average of the Close • If the 100MA is less than the previous bar’s 100MA, then 100MA is down. (colorRed) • If the 100MA is more than the previous bar’s 100MA, then 100MA is up. (colorGreen) • If the 100MA is equal to the previous bar’s 100MA, then 100MA is flat. (colorBlack) • 100MA direction is always relative to previous bar ....................................................................................................... • Overall Trend Direction has 3 possibilities – GREEN (Up), RED (Down), BLACK (Flat) • GREEN changes to BLACK if 100MA is down and price closes below 100MA in last 15 bars inclusive of the current bar • RED changes to BLACK if 100MA is more than last bar’s 100MA and price closes above 100MA in last 15 bars inclusive of the current bar • BLACK changes to GREEN if the 100MA is up for 15 consecutive bars inclusive of the current bar • BLACK changes to RED if the 100MA is down for 15 consecutive bars inclusive of the current bar • GREEN can never change to RED and RED can never change to GREEN WITHOUT a BLACK period in between. ....................................................................................... THANK YOU VERY MUCH!
×
×
  • Create New...

Important Information

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