Hello, I am developing a strategy based on levels of fibo time extension. The fibo is currently plotted from the last low to the new high calculated at each tick. The problem is that I am not able to anchor the start of the fibo to the candle that marked the last minimum, but remains in the value of candles behind that is established (2). Could you help me? Thank you
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
fibo time extension
Collapse
X
-
fibo time extension
Hello, I am developing a strategy based on levels of fibo time extension. The fibo is currently plotted from the last low to the new high calculated at each tick. The problem is that I am not able to anchor the start of the fibo to the candle that marked the last minimum, but remains in the value of candles behind that is established (2). Could you help me? Thank youTags: None
-
Hello kunkun80,
Thank you for the post.
If I have understood the question I believe you are asking how to know how many BarsAgo to use to find a specific bar when using OnEachTick, is that correct?
If you have a certain bar which should be stored you generally would use the CurrentBar value at that time and store that to a variable. You can then subtract that from the CurrentBar at any point to find the total BarsAgo between those two points. Is that what you are trying to accomplish?
I look forward to being of further assistance.JesseNinjaTrader Customer Service
-
Hi Jesse, The candle that starts the momentum is defined. My long fibo has to start at the low of the first candle that starts a new swing (ninja indicator), the end of the fibo is updated according to new highs (I have solved that part). I guess it won't be too complex but I'm a bit of a ninja novice. Thank you
Comment
-
Hello kunkun80,
Thank you for the reply.
Just to clarify did you still need assistance with part of this? I am not certain from your reply if you still had a question or if you are working on a solution. If you still needed assistance can you provide more detail about what you needed help with?
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Hello kunkun80,
Thank you for the reply.
What specifically did you need help with in regard to the beginning of the fibo?
Was my comment in post 2 accurate on what you needed assistance with? I understand you are having trouble with something related to the placement but you would need to be much more specific as to what you need help with in your code.
Did you already code something? If so what did you code and what part of that is not working? If you have a sample of the code you used and can provide a description of what is not working as you expect with that code that would help to better explain the question.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Hello kunkun80,
Thank you for the reply.
Are you trying to make the stationary start bar the same bar as when you set InicioSwing?
If so you can use an int variable to store the CurrentBar at that time, the BarsAgo can then be calculated like the following:
Code:[B]private int storedStartBar = 0;[/B] protected override void OnBarUpdate() { if (BarsInProgress != 0) return; if (CurrentBars[0] < 2) return; // Set 1 if ((Low[0] >= Swing1.SwingLow[0]) && (Buscamax == 0) && (BuscaSwing == 0)) { Maximo = High[0]; Buscamax = 1; InicioSwing = Low[0]; BuscaSwing = 2; [B]storedStartBar = CurrentBar;[/B] } // Set 2 if ((Buscamax == 1) && (BuscaSwing == 2)) { Draw.FibonacciRetracements(this, @"swing Fibonacci retracements_1", false, 2, InicioSwing, 0, Maximo); Draw.FibonacciTimeExtensions(this, @"swing FTE", false, [B]CurrentBar - storedStartBar[/B], InicioSwing, 0, Maximo); }
JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Rapine Heihei, Today, 08:19 PM
|
1 response
8 views
0 likes
|
Last Post Today, 08:30 PM | ||
Started by Rapine Heihei, Today, 08:25 PM
|
0 responses
6 views
0 likes
|
Last Post Today, 08:25 PM | ||
Started by f.saeidi, Today, 08:01 PM
|
1 response
9 views
0 likes
|
Last Post Today, 08:17 PM | ||
Change colour of Stop market and limit orders to red and green via indicator script
by Rapine Heihei
Started by Rapine Heihei, Today, 07:51 PM
|
0 responses
8 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by frslvr, 04-11-2024, 07:26 AM
|
5 responses
98 views
1 like
|
Last Post
by caryc123
Today, 07:47 PM
|
Comment