NexusFi: Find Your Edge


Home Menu

 





Can anyone help convert this pine script to c# or vb?


Discussion in MultiCharts

Updated
    1. trending_up 3,504 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

Can anyone help convert this pine script to c# or vb?

  #1 (permalink)
jmi8844
Chicago
 
Posts: 2 since Oct 2020
Thanks Given: 0
Thanks Received: 1

Can anyone help convert this pine script to c# or vb? I would like to backtest it in multicharts Net. Thanks in advance.

length = input(30, minval=1)
Value = input(30, minval=0)
highsma = sma(high, length)
lowsma = sma(low, length)
swing = iff(close > highsma[Value], 1, iff(close < lowsma[Value], -1, 0))
mah = highest(high, length)
mal = lowest(low, length)
stop = iff(swing==1, mal, iff(swing==-1, mah, stop[1]))
linecolor = iff(stop < low, green, red)
plot(stop, style=line, linewidth=2, color=linecolor)

len1 = input(1, "Base Length")
src = input(close, "Source")

sma1 = sma(src, len1)

longcondition = crossover(sma1,stop)
shortcondition = crossover(stop,sma1)

plotshape(longcondition, style = shape.triangleup, color = green, location = location.belowbar, text = "Long", size = size.small)
plotshape(shortcondition, style = shape.triangledown, color = red, location = location.abovebar, text = "Short", size = size.small)

alertcondition(longcondition, "Long", "Long")
alertcondition(shortcondition, "Short", "Short")

Reply With Quote




Last Updated on October 14, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts