NexusFi: Find Your Edge


Home Menu

 





Need help to make a strategy to create fibs, and place order if fib are hit NT8 (New)


Discussion in NinjaTrader

Updated
    1. trending_up 1,455 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 2 attachments




 
Search this Thread

Need help to make a strategy to create fibs, and place order if fib are hit NT8 (New)

  #1 (permalink)
Robinson94
Paris / Īle de France / France
 
Posts: 20 since Aug 2016
Thanks Given: 2
Thanks Received: 38

Hello !
I'm trying to create a semi-automated strategy (not an atm strategy), but a strategy that will not make any decisions, but that can draw a fib extension, adjust the fib if the point where the fib has been drawn is broken, and, if a certain fib level is hit, start to create an atm order, to start to trail a trade opened with an atm strategy, and then adjust on the value of an simple indicator that i made, that has only one value, to trail a trade.
(by the way, i made this thread 3 days ago, but i just saw that there was a subdivision for ninjascript programming, so i'm re-making the thread )

This is the basic explanations of what i would like, so let me explain why :
I'm a long-term day-trader, and there is a lot of peoples that do the same thing as me, but long term, this mean that i can be in a trade for 6-8 hours. But after the entry is made, i actually don't take any decisions, and i'm only waiting for a fib level to get hit, and to create a stop market order, to trail a trade, then i attach this order to the value of an indicator.
But, i think we can all agree, having to spend 6-8 hours in front of a screen, to press 2 buttons, is really annoying, and also, you can't have your mind clear, if for example you walk away from the screen.
A strategy like the idea i have in mind, could help a lot of traders to make their life easier, and to reduce time lost in front of a screen to press a button, and reduce stress.

I have tried to build this, and i have been helped with the ninjatrader support team (i'm trying to build this on NT8), they are doing a great job, but really quickly, in more complex questions they only point me to documentation, that is not documented enough to do the job ! And i don't think third part developer is the way to go, because of the way of doing of many, to do the job quickly, to do a lot of it, but facturing a lot time, and we can also ended up with a code that we don't understand, and can't modify. So that's why i'm here !
Whit the ninjatrader support team, i didn't succeed building what i wanted, but i learn what is possible to do with NT8, and so i have created a detailled plan on how we could create this. So, if you want to help or contribute to create this strategy, to make gain a lot of time to a lot of peoples, it would really be appreciated !


So : the idea of the strategy, or script, is to keep the freedom of opening a trade with the dom, and a atm strategy, and having a atm strategy stop loss that don't move (created by the atm strategy, not by the automated strategy). And i have a target, based on one particular fib extension level, but this level is dynamic, and can change if the point where i placed it is broken, and my stop not hit, to avoid to have, for exemple an input with the target price in the strategy, but then, we have to stay in front of the charts to adjust the extension if needed, and so we are back to square one.

- With this in mind, the first thing that the strategy need to do, is to be enable to draw, or adjust a fib extension. But before this, here's the basics stuff that could be great for the strategy to have :
- the strategy can start working, only if we are short or long, in the instrument where she is applied, and on the account that we set before. To avoid, like to forgot to disable the strategy, and then she's going to take order to open a position, instead of taking order to leave a position.
- The strategy will detect if we are long or short, and then start to use the short, or long version of the strategy.
- if the strategy has an error, she will cancel all positions on the instruments, and delete all orders.
- the strategy will use the amounts of contracts that are in the actual trade, to set the amount of contracts she need to put in her order.
- the strategy cancel everything and every order 3060 seconds before the close of the instrument


- About the extension, the strategy should be enabled to draw or adjust a fib extension (we can either, choose the 3 points on the chart where she should draw the extension, or we can put the value of the 3 points in a input before we launch the strategy). Then, when the strategy has the 3 points, and has drawn the extension, she's going to take the value of the 85,4% fib level (with an offset of -5ticks if the account is long, and +5ticks if the account is short), so if the strategy see that the price has reach at any time (not close above the target price), the target price (and she take the offset, so 5 ticks below or above), she's going to start the trail stop that i'm going to explain after. But so, she use the 85,4% fib level with an offset (if the offset could be modified it would be great !) to set the target.
The first 2 point of the fib extension (in case of a long trade, the first low and high), will never move, so we don't worry about them (ps : the atm stop loss is placed manually by the atm strategy below the first point, but the strategy don't care about the stop loss created by the atm strategy. But so, if the first point where the extension is drawn is broken, we are going to get stop out anyway, and if the strategy see that the account became flat on the instrument, she will stop).
But the tricky thing, is that the third point can change. Let's say we have taken the input to had manually to set the points of the extension, and that i have taken the trade a long trade a little after the third point (the low), this low can be broken, without triggering the stop loss, but in this case, the fib extension, is not placed at the good low.
So my idea, is that the strategy take the third point value put by the user, and considerate this point as a low (or a high if the strategy see that the account is short), and if the strategy see that at any time this low is broken, she will considerate, that the new low since the low put by the user, is here new low. And she will delete and draw a new extension (or adjust), based on still the 2 first points, but she will by itself, take the new low has a third point to create the extension.
If this new low is broken again, she will do the same operation, and if we keep breaking low, until my stop loss is hit, the strategy will see that the account is flat, and will shutdown.
And, she will always take the new 85,4% fib level with the offset, as her target level. (i'm going to explain what is the target level)


- Now that we have our dynamic fib extension, we have one more thing to do, is that the strategy use the target level as a point to start to trail the trade. Since the strategy, just need to know, what is the side of the trade (long or short), to work, she don't care about the stop loss made by the atm strategy, or the entry price. All that the strategy will do, is constantly check, and wait, if the price has reach the price of the target with the offset. Then if the price do hit the target price, the strategy will create an atm order (so the user can see the order and adjust it if needed, but its managed by the strategy), an sell stop market order (or a buy if i'm short), then she will attach it to the value of an indicator that will just create a plot if the candle is green (close above open), (there is 2 versions that i build, the long version, that will be used if i'm a in a long trade, and the short version, used if i'm short, the long create dot on up candle, and short on down candle), (i posted the indicators in this post), (by the way, if the strategy need to create the order before it can be ajustes, it could be a idea to put a sell market stop on a -1 value, and a buy on a 9999999999 value, to be sure its not hit. Then, when the order is created, she adjust the order on the value of the good indicator depending on the direction of the open trade, she adjust with an offset of -1 if i'm long, and +1 if i'm short (so the order is one tick below the candle if long, and one above if short). And then, on a bar close base, she will see if the value of the indicator is different, and she will try to move the order to the new value of the indicator if its different.

Then, when the order is triggered and filled, obviously, the account become flat, and since the atm strategy is canceled when the account become flat, the stop loss will be deleted. Then the last goal of the strategy, is to check if there is any order, or position left on the instrument, if there is, she will canceled or close all this, then she will shutdown, and send a message to NT8 like : TrailStop finished, and all positions closed.


That's the plan, i try to make it as detailed as possible, so it would be easier for somebody who want to try to programme, or help programming this thing to understand the plan.

It would really help a lot of people if we can succeed on building this, you can totally contact me on pm about this, or the best, is to speak trough this tread, so a maximum of peoples can get value out of this.

Have a great day !

PS : the two indicators that i posted, are for nt8

Attached Files
Elite Membership required to download: LONGAutotrailstop.zip
Elite Membership required to download: SHORTAutotrailstop.zip
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
23 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 5,972 since Sep 2015
Thanks Given: 15,487
Thanks Received: 15,383


Hi there

Not sure if you realized but you created the same post in two different threads.


@Big Mike or @sam028 FYI as duplicate.

Reply With Quote
  #4 (permalink)
Robinson94
Paris / Īle de France / France
 
Posts: 20 since Aug 2016
Thanks Given: 2
Thanks Received: 38

Yes !
Thanks for pointing it, i fully know that i have made two time the same thread, but i think the ninjatrader programming section it better for this thread.
I have posted has soon has i upload this thread, in a old thread a link to this one, and if a moderator was passing by that the old thread could be removed.
And, to have no confusion, on the start of this thread, i said that i posted it 2 time, and the name of this thread is New !

Anyway, i cannot delete the old thread myself ?

Thanks for pointing it and quoting big mike. (by the way, i don't know what FYI as duplicate mean, but the thread that i would like to keep is this one, and the one that could be good to remove is this one : https://nexusfi.com/ninjatrader/42569-need-help-make-strategy-create-fibs-place-order-if-fibonacci-hit-ninjatrader-8-a.html

Reply With Quote
Thanked by:
  #5 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 5,972 since Sep 2015
Thanks Given: 15,487
Thanks Received: 15,383


Robinson94 View Post
Yes !
Thanks for pointing it, i fully know that i have made two time the same thread, but i think the ninjatrader programming section it better for this thread.
I have posted has soon has i upload this thread, in a old thread a link to this one, and if a moderator was passing by that the old thread could be removed.
And, to have no confusion, on the start of this thread, i said that i posted it 2 time, and the name of this thread is New !

Anyway, i cannot delete the old thread myself ?

Thanks for pointing it and quoting big mike. (by the way, i don't know what FYI as duplicate mean, but the thread that i would like to keep is this one, and the one that could be good to remove is this one : https://nexusfi.com/ninjatrader/42569-need-help-make-strategy-create-fibs-place-order-if-fibonacci-hit-ninjatrader-8-a.html

Yep, perhaps it's best that you send the request directly to @Big Mike yourself and he should be able to help.

Reply With Quote




Last Updated on July 6, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts