Have problem with trailing stop - EasyLanguage Programming | futures io social day trading
futures io futures trading


Have problem with trailing stop
Updated: Views / Replies:646 / 5
Created: by kissdish 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 90,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

Reply
 
Thread Tools Search this Thread
 

Have problem with trailing stop

  #1 (permalink)
Trading Apprentice
nanjing china
 
Futures Experience: Advanced
Platform: multicharts
Favorite Futures: france40
 
Posts: 3 since Jul 2015
Thanks: 0 given, 1 received

Have problem with trailing stop

I want to write a custom trailing stop, the code snippets like this

if MarketPosition <> 0 then
begin
tStopLoss = VerifyStopLoss(value4, AvgValue, OrderSlot, BuyOrSell, LogLevel);

if tStopLoss <> 0 then
begin
value4 = tStopLoss;
end;

if BuyOrSell <> 0 then
begin
sell next bar at value4 stop;
end
else
begin
buytocover next bar at value4 stop;
end;
end;

the VerifyStopLoss function will caculate the new stop price and i know it work correctly, now the problem is that no any stop order will be submitted while the sa model is turned on, i dont know why.

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.

 
  #3 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary


kissdish,

it's hard for anyone to guess what could be the problem without being able to check the values from the function. You should add print commands to your code and check the values yourself to see if they are correct. This will help you to track the issue down.

Regards,
ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #4 (permalink)
Trading Apprentice
nanjing china
 
Futures Experience: Advanced
Platform: multicharts
Favorite Futures: france40
 
Posts: 3 since Jul 2015
Thanks: 0 given, 1 received

thank you for your reply, i have checked the function and ensure it will return correct value, now i wondered is there anything wrong i use the sell and buytocover command, as no any stop order be submitted. does anyone know that if i want to write a custom trailing stop, what function or command is the standard method, setstoploss?

Reply With Quote
 
  #5 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


kissdish View Post
i have checked the function and ensure it will return correct value, now i wondered is there anything wrong i use the sell and buytocover command, as no any stop order be submitted.

Do you have an open position when this script is applied to the chart? That's all I can guess based on the information you've provided.


kissdish View Post
does anyone know that if i want to write a custom trailing stop, what function or command is the standard method, setstoploss?

The code snippet that you showed already is a custom stop; you only need to make it trailing. If you implement SetDollarTrailing() then it won't be custom anymore.

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
nanjing china
 
Futures Experience: Advanced
Platform: multicharts
Favorite Futures: france40
 
Posts: 3 since Jul 2015
Thanks: 0 given, 1 received

thanks for your replay, i have solved this problem, the reason is the marketpostion will always return 0 while the SA is turned on, it's incorrect, maybe some bug with the broker's plug-in, i change a broker or use marketpostion_at_broker and the code run well. thank you all


Last edited by kissdish; August 14th, 2015 at 11:33 AM.
Reply With Quote
The following user says Thank You to kissdish for this post:

Reply



futures io > > > > > Have problem with trailing stop

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
trailing stop or fixed? mannya Psychology and Money Management 16 July 30th, 2015 03:59 AM
Problem with Trailing Stop getting filled / Execution djvie11 EasyLanguage Programming 1 June 29th, 2015 02:39 PM
Trailing stop edstaffin NinjaTrader Programming 5 October 30th, 2014 02:55 PM
Fee's For Stop Loss / Trailing Stop rkersh409 Reviews of Brokers and Data Feeds 3 May 29th, 2014 05:15 PM
Ninjatrader strategy for Trailing Stop and stop loss. skann NinjaTrader 2 August 20th, 2013 08:34 PM


All times are GMT -4. The time now is 04:17 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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
Page generated 2017-12-15 in 0.09 seconds with 19 queries on phoenix via your IP 54.90.92.204