Java Adj Trailing stop strategy help please :) - NinjaTrader Programming | futures io social day trading
futures io futures trading

Java Adj Trailing stop strategy help please :)
Updated: Views / Replies:751 / 1
Created: by sickwake Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

Java Adj Trailing stop strategy help please :)

  #1 (permalink)
Vancouver BC Canada
Posts: 1 since Feb 2014
Thanks: 0 given, 0 received

Java Adj Trailing stop strategy help please :)

Hey guys,

New at Programming. Using Java to code my strategy for automated day trading. My plan is simple. Just need some help with the code and where to go from here.

The plan is to have a trailing stop that adjusts as the market moves in favour of the trade. For Example (Going Long/buying): Enter the market at specified entry price and it moves up in favour of the trade. When the price reaches 50% of the way between entry price and target price the trailing stop is adjusted and is adjusted one last time when target price is reached.

What I have thus far... (A really rough first draft as you can see!)

public class StockExample {
public static void main(String[] args) {
double MarketPrice;
double EntryPrice; // EntryPrice == Stop Price
double TargetPrice;
double TrailStop;
double TrailStop2; //Initial Trail Adjusted 50%
double TrailStop3; //Trails .05 behind TargetPrice
TrailStop2 = TargetPrice - EntryPrice/2 +.02;
TrailStop3 = TargetPrice - .05;

if (TrailStop == 50% TargetPrice) {
if (TrailStop2 == .05 - TargetPrice );
System.out.println("Target Price not met.");

Also wanting to add this new rule and convert it to code...

If Market price exceeds Entry Price by .15 and is not triggered cancel trade ( like a gap were to occur or something)
Figure it would have to look something like this?

if (MarketPrice > EntryPrice + 0.15)
System.out.println("Cancel Trade");

Any help will be appreciated. Cheers

Reply With Quote
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


futures io > > > > > Java Adj Trailing stop strategy help please :)

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

Show us your trading desks and win $1,400 in prizes w/Earn2Trade


futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using SuperTrend for trailing stop in a strategy - help needed DarrenH NinjaTrader Programming 16 September 29th, 2017 11:03 PM
Auto Trailing Stop Strategy sandptrader NinjaTrader 19 February 27th, 2017 05:09 PM
Ninjatrader strategy for Trailing Stop and stop loss. skann NinjaTrader 2 August 20th, 2013 08:34 PM
Simple trailing stop strategy jeemba EasyLanguage Programming 2 August 2nd, 2013 08:05 AM
Exit at close for trailing stop strategy skorpyo ThinkOrSwim Programming 0 July 27th, 2013 05:56 AM

All times are GMT -4. The time now is 08:49 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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.
no new posts