How to override Stoploss generated by a strategy in Superdom - NinjaTrader Programming | futures io social day trading
futures io futures trading


How to override Stoploss generated by a strategy in Superdom
Updated: Views / Replies:1,841 / 9
Created: by puppeye Attachments:2

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
 

How to override Stoploss generated by a strategy in Superdom

  #1 (permalink)
Elite Member
hk
 
Futures Experience: Beginner
Platform: ninjatrader
 
puppeye's Avatar
 
Posts: 56 since Aug 2009
Thanks: 89 given, 425 received

How to override Stoploss generated by a strategy in Superdom

Hi everyone, I have created a strategy which sets my stop automatically (using setstoploss). I want to be able to change my stop manually in superdom while the strategy is still running. The problem is whenever I change my stop in superdom manually, my stop will automatically change back to the level defined in setstoploss() in the strategy.

I understand that instead of using iorder related procedures (such as enterlonglimit), I can use AtmStrategyCreate() which will allow me to change my stop or profit target manually in superdom. But my strategy requires iorder functions.

Is there a way which I can manually change my stop and override setstoploss() in a strategy while it is still running?

Thanks in advance.


Last edited by puppeye; February 27th, 2010 at 01:16 AM.
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)
Elite Member
Brisbane, Australia
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL
 
nanobiotech's Avatar
 
Posts: 670 since Jun 2009
Thanks: 134 given, 428 received


I have wished I could do this many times, but haven't seen a way to do it yet.

Nano

Reply With Quote
 
  #4 (permalink)
Elite Member
Madison, WI
 
Futures Experience: Advanced
Platform: Sierra Charts, ALT
Favorite Futures: ES
 
aslan's Avatar
 
Posts: 614 since Jan 2010
Thanks: 342 given, 1,077 received

I have been working on this recently, and can post some examples next week when I get back from vacation. What you need to do, is monitor the stop and target orders as they change state. As the state changes to pending change, you can capture the new stop/limit price and store it in a var, and then use that var to set your new stop/target on the next tick in OnBarUpdate().

Reply With Quote
The following 2 users say Thank You to aslan for this post:
 
  #5 (permalink)
Elite Member
hk
 
Futures Experience: Beginner
Platform: ninjatrader
 
puppeye's Avatar
 
Posts: 56 since Aug 2009
Thanks: 89 given, 425 received

Thanks aslan, I figured that out as well after i posted, i have also added a discretionary button to the chart so that i can switch to "manual mode". Will post an example soon.

Reply With Quote
 
  #6 (permalink)
Elite Member
hk
 
Futures Experience: Beginner
Platform: ninjatrader
 
puppeye's Avatar
 
Posts: 56 since Aug 2009
Thanks: 89 given, 425 received

by the way, this forum is far better than ninja support forum!

This is the "standard answer" i've got from them ---- "puppeye, unfortunately not - to be able to manage strategy generated orders manually on ChartTrader and the DOM's you would need need work with calling ATM templates for exit management."

Reply With Quote
The following 3 users say Thank You to puppeye for this post:
 
  #7 (permalink)
Elite Member
Madison, WI
 
Futures Experience: Advanced
Platform: Sierra Charts, ALT
Favorite Futures: ES
 
aslan's Avatar
 
Posts: 614 since Jan 2010
Thanks: 342 given, 1,077 received


puppeye View Post
by the way, this forum is far better than ninja support forum!

This is the "standard answer" i've got from them ---- "puppeye, unfortunately not - to be able to manage strategy generated orders manually on ChartTrader and the DOM's you would need need work with calling ATM templates for exit management."

Isn't that hilarious, not. They don't even know how to use their own platform. I started working on this for similar reasons that you did. In the past I used ATM strategies live because I could manage them from the DOM, but that has a major disadvantage in that you can not back test with ATM. I had searched the forums, and I found nothing. So, I started working on a generic strategy that was like the ATM strategy. The one useful thing I found in the forum recently was a nice example to add a button to the toolbar, which you can use to set a var to enable/disable the strategy on the fly or to flatten a position.

Reply With Quote
 
  #8 (permalink)
Elite Member
SE-Asia
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Amp
Favorite Futures: ES
 
Posts: 141 since Jun 2009
Thanks: 57 given, 114 received


nanobiotech View Post
I have wished I could do this many times, but haven't seen a way to do it yet.

Nano

This behavior is because you continuously make a call to setstoploss, you can add some bool to the initial statement just to ensure your code only manipulate the stop once, then afterward you can manipulate manual.

Maybe similar to this:

if( your condition && !Breakeven)
{
set your stop in here
Breakeven = true;
}

Reply With Quote
 
  #9 (permalink)
Elite Member
hk
 
Futures Experience: Beginner
Platform: ninjatrader
 
puppeye's Avatar
 
Posts: 56 since Aug 2009
Thanks: 89 given, 425 received

Attached is an example which I have created to allow you to manually change the stop controlled by a strategy. You will see that I have also added a button to the chart to switch between "auto mode" and "manual mode".

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Attached Files
Register to download File Type: zip ManualStop.zip (1.6 KB, 52 views)
Reply With Quote
The following 6 users say Thank You to puppeye for this post:
 
  #10 (permalink)
Elite Member
hk
 
Futures Experience: Beginner
Platform: ninjatrader
 
puppeye's Avatar
 
Posts: 56 since Aug 2009
Thanks: 89 given, 425 received


Prtester, even if setstoploss() is called once only, the strategy will continue to control it as long as the strategy is still running.

Reply With Quote

Reply



futures io > > > > > How to override Stoploss generated by a strategy in Superdom

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
stoploss to breakeven to trailing stephenszpak NinjaTrader Programming 13 October 13th, 2014 04:30 PM
Define user variables to hold key levels generated by Market Profile trendisyourfriend Investor/RT 5 May 2nd, 2011 07:51 PM
A Random Walk Stopped: My Journey to find the balance between Stoploss/ProfitTarget fctrader Trading Journals 26 March 10th, 2011 04:16 PM
StopLoss as fraction of ATR FArias NinjaTrader Programming 5 February 23rd, 2011 03:45 PM
Help Coding Trailing stoploss in Strategy Darshiit NinjaTrader Programming 3 June 25th, 2010 10:45 AM


All times are GMT -4. The time now is 04:44 AM.

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.12 seconds with 20 queries on phoenix via your IP 54.234.255.29