In Progress

Need VT-Trader Code converted to Amibroker AFL

I need a system that I use on my trading platform VT-Trader (Which I think is similar to Metastock code) converted to Amibroker code. The PREV function is what is causing me problems and although I do understand loops I still cannot get it to work the correct way.

This is an always-in-the-market system that works by trailing the current price using a volatility-based stop.

When the stop is hit, instead of closing the position, it is reversed (hence, always in the market

You can sign up a demo account with cmsforex to trial vt-trader to see what the result needs to be.

This is the VT code

......................................................................

{RGM Master Trading System}

RGM_Power_Line_Setup:= (Wilders(ATR(30),24)*[url removed, login to view]);

RGM_Power_Line:= If(BarCount()>(30+24),

If(Ref(C,-1)>PREV(0) AND C>PREV(0),Max(PREV(0),C-RGM_Power_Line_Setup),

If(Ref(C,-1)<PREV(0) AND C<PREV(0),Min(PREV(0),C+RGM_Power_Line_Setup),

If(Cross(C,PREV(0)),C-RGM_Power_Line_Setup,

If(Cross(PREV(0),C),C+RGM_Power_Line_Setup,

If(C=PREV(0),PREV(0),PREV(0)))))),

NULL);

{Signal Buy and Sell}

LongSignal:= Cross(C,RGM_Power_Line);

ShortSignal:= Cross(RGM_Power_Line,C);

{Auto-Trading Functionality; Used in Auto-Trade Mode Only}

OpenBuy:= LongSignal AND (EventCount('OpenBuy') = EventCount('CloseBuy'));

CloseBuy:= ShortSignal AND (EventCount('OpenBuy') > EventCount('CloseBuy'));

OpenSell:= ShortSignal AND (EventCount('OpenSell') = EventCount('CloseSell'));

CloseSell:= LongSignal AND (EventCount('OpenSell') > EventCount('CloseSell'));

.................................................................................

Skills: C Programming, Financial Markets, Metatrader, Windows Desktop

See more: trader afl, eventcount amibroker, trailing stop afl, afl code, buy sell amibroker afl, code get, code buy, amibroker atr, trader trading system, prev amibroker, vt, trade market, stop account, signal system, prev, null, metastock, closing account, amibroker afl, afl, cross sell, amibroker function, cmsforex, sign problems, platform code

About the Employer:
( 1 review ) Brisbane, Australia

Project ID: #585397

Awarded to:

apfx

your project is ready

$100 USD in 0 days
(8 Reviews)
3.5

3 freelancers are bidding on average $127 for this job

BoterM

Hello, Thank you for invitation. I am interested in your project. See more details in PMB, please.

$200 USD in 3 days
(24 Reviews)
6.0
ColVentures

Kindly take a look at my PM regarding the details of my bid.

$80 USD in 5 days
(1 Review)
0.0