Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
please help me convert easy language to pine script
{ Buys if Price crosses over Avg and then stays above Avg for one or more bars }
inputs:
Price( Close ) [DisplayName = "Price", ToolTip =
"Enter an EasyLanguage expression to use in the moving average calculations."],
Length( 9 ) [DisplayName = "Length", ToolTip =
"Enter the number of bars used in the calculation of the moving average."],
ConfirmBars( 1 ) [DisplayName = "ConfirmBars", ToolTip =
"Enter the number of bars required to confirm the cross of price above the moving average."];
variables:
Counter( 0 );
if Price > AverageFC( Price, Length ) then
Counter = Counter + 1
else
Counter = 0;
{ CB > ConfirmBars check used to avoid spurious cross confirmation at
CB = ConfirmBars }
if CurrentBar > ConfirmBars and Counter = ConfirmBars then
Buy ( !( "MACrossLE" ) ) next bar at market;
Can you help answer these questions from other members on NexusFi?
Then you need to have this statement : Buy ( !( "MACrossLE" ) ) next bar at market;
replaced with a Plot1 statement and then set the colors with SetPlotColor(1,Green) for bullish
and SetPlotColor(1,Red) for bearish.