Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
ATM in ninja script strategy
Collapse
X
-
This will not work as you constantly update your reference value then with the RSI being under the treshhold value - you want to record the value of it crossing below it...then you can check on the following bars if the new values are smaller or not and thus if a new lowest reference value need to be saved or not.
-
-
luxurious_04, unfortunately we could not code this out for you, however something along those lines would be needed -
if (yourCondition) refValue = RSIValue;
if (RSIValue < refValue)
refValue = RSIValue
else
refValue = refValue[1];
The will let you keep a reference to the lowest RSI value since your condition evaluated to 'true'.
Comment
-
Thanks Bertran I understand your side but this will be a great help for me. This refValue, do I need to declare this on the variable section as double?
Comment
-
-
if (RSI(RSIperiod, RSIsmooth).Avg[0] <= 20)
{
refValue = RSI(RSIperiod, RSIsmooth).Avg[0];
Print("The Current RSI average is:" + refValue);
Print("Time is:" + Time[0]);
}
if (refValue < RSI(RSIperiod, RSIsmooth).Avg[0])
{
refValue2 = RSI(RSIperiod, RSIsmooth).Avg[0];
Print("lower" + refValue2);
}
else
{
refValue2= refValue;
Print("The RSI is higher than the previous" + refValue2);
Print("remain the value");
}
It's not working well, please help on this.
Comment
-
Hello Bertran, I just want to ask if my strategy is calculated tick by tick for example a 50 tick. Itwill only ran properly in a chart that is a 50 tick interval? Because I tried to test the strategy in a 10 minute chart and I set my strategy properties into a tick type and set to 50 then session template to default 24/7 and then my strategy is not working well. But when I change the properties to minute type and set it to 10 and my session template is used instrument setting. It does mean that if your strategy is tick by tick type then you will going to build a new chart that is a tick by tick and ran it in there?
Comment
-
luxurious_04, I'm not sure I follow you - if your rules trigger conditions you would see trades on the tick or minute charts, there's per se no logic that would prevent a strategy not to run on a specific interval. If you're working with the ATM's please don't attempt to backtest them, they will only work in Market Replay or live testing.
Comment
-
Atm Strategy add-on
Hello Bertran:
Bertran thanks for all your suggestions or ideas that you've share to me. Here me again need for your help in adding an add-on to the atm strategies. If I have an pending order that have not or already filled and there is another open entry signal I would like to take that as add on. Is there a way of that? If there is please give me a tip.
Comment
-
My atm strategy missed good signal entry because of the orderId and strategy is not yet empty. Any help for this? How about i will reset the two id's when the order is filled so that it will get the next signal entry? What will happen?
Comment
-
Time problem
Hello Bertran I have a time filter problem:
startTime = new DateTime(0001, 1, 1, 6, 30, 00); // ignore the date portion. It is unused
endTime = new DateTime(0001, 1, 1, 15, 20, 00);
if (ToTime(Time[0]) >=ToTime(startTime) && ToTime(Time[0]) <= ToTime(endTime))
In the market replay it will not start to trade at 6:30 am and end trade at 15:20. It works well in the market replay but in live it will not start to trade at 6:30 which is supposed to be to trade.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
649 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
573 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
576 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment