Find Jobs
Hire Freelancers

Tradestation Easylanguage programming (1732157)

$30-100 USD

Closed
Posted over 12 years ago

$30-100 USD

Paid on delivery
I have a code that I've used for backtesting that I have traded manually. I'm now trying to use it for Autotrading in MultiCharts / Tradestation. However there are some logical errors when the orders are beeing sent out. When using the code below there could be different orders in the market at the same time. I've also found an issue when the trailing stop is active. Say I'm long and have the initial stop&reverse in the market and also using a trailing stop. If the trailing stop level moves one tick above the initial stop level the trailing is active. Now I have a stop order at the trailinglevel and a stop&reverse order one tick below. The stop&reverse order is twice as big as my current position. (flat+short) I'll attach a pic to make it easier to understand what I mean. (It shows a short position but the issue is the same) Auto Trading: [img][login to view URL][/img] Manual Trading: [img][login to view URL][/img] ## Deliverables Code: /////////////////////////////////////////////////////////////////// **[code]** if marketposition = 1 and shorttrade1 = false then begin longtrade1 = true; lstp1 = InitialLongStop1 ; if UseMoveToBreakEven and h >= entryprice+BreakEvenFactor then begin lstp1 = MaxList(lstp1, entryprice); sell ("ExitLong1BE") from Entry ("Long1") next bar at lstp1 stop; end; if UseTrailing and time >= TrailingStartTime and TrailLevel > lstp1 then begin lstp1 = MaxList(lstp1, TrailLevel ); sell ("ExitLong1 TRAIL") from Entry ("Long1") next bar at TrailLevel stop; end; if time >= CloseTime then sell ("ExitLong1 EOD") from Entry ("Long1") this bar at c; if time < NoNewPositionsTime and shorttrade1 = false then begin sellshort ("Short2") 1 contract next bar at SellLevel stop; sstp2 = InitialShortStop2; BuyToCover ("InitExit Short2") from Entry ("Short2") next bar at sstp2 stop; end; **[/code]** ///////////////////////////////////////////////////////////////////////////////// The logic I'm looking for: - If I'm long 1 contract I want to have a stop&reverse at a specified level below the entryprice. (lstp1) (Flat and Short at the same level.) - If I'm long 1 contract and using UseTrailing and the trailing stop is above the initial stop&reverse I want to Sell 1 contract at the trailing level and 1 contract at the initial stop&reverse level. (Flat and Short at two different levels) - If I'm long 1 contract and using MoveToBreakEven and the BreakEven level is above the initial stop&reverse I want to Sell 1 contract at the BreakEven level and 1 contract at the initial stop&reverse level. (Flat and Short at two different levels.) - If I'm long 1 contract and using MoveToBreakEven and UseTrailing I want to sell 1 contract at the highest of the two and 1 contract at the initial stop&reverse level. (Flat and Short at two different levels.) You can either change the existing code or make a new one. However, it's important that works for autotrading and not only backtesting. Regards, Lars
Project ID: 3546930

About the project

1 proposal
Remote project
Active 13 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
1 freelancer is bidding on average $8,089 USD for this job
User Avatar
See private message.
$8,089.25 USD in 14 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of SWEDEN
Bollebygd, Sweden
5.0
24
Member since Oct 27, 2007

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.