I am teaching myself how to code indicators.
How do I get values from a specific bar? For example, if I want the high price of the 5th bar back from the current bar, how would I do that? How can I choose that specific bar? How can I find the high price?
Thanks for helping me.
It really depends on what you’re trying to accomplish. Below are two different scenarios.
You can add something like this to your map{} and remember to add It to the return{}:
map{}
const high5CandlesAgo = history.get(i - 5).high();
const low5CandlesAgo = history.get(i - 5).low();
return{}
high5CandlesAgo: high5CandlesAgo,
low5CandlesAgo: low5CandlesAgo
and if you want too calculate a level of the current candle relative to the previous candles high or low etc…add it to the return and you can do something like this:
return{}
high: d.high(),
open: d.open(),
close: d.close(),
low: d.low(),
function trendPlotter
if (next !== null) {
// Calculate the center point between the prior high and the next candle's open
const centerPoint = (prior.high + next.open) / 2;
hope that gives you some ideas…
Thankyou !
I will work on this soon
Right now I am overwhelmed learning about Tradovate.
Relatively new user. No real computer coding skills but can hack
Quick Question.
What are the steps to load this on Tradovate?
Example where do I start to copy and paste code in order to build an indicator.
I can do this on ThinkorSwim all the time, but for some reason I am not immediately
Grasping the steps to place a new custom indicator on my platform
Are you able to quickly give me a 1,2,3 example? If so , I would greatly appreciate it.
Best wishes.
Fred
7/12/2023 11:58 PM
i know this forum is dead and this is an old post but this isnt working?
if i use the history.get to return any index further than one bar back i am getting an undefined error for any bar properties (open/high/low etc…).
if i return the previous bar (i - 1) or use history.prior() i am able to access whatever i want.
running the following code:
returns this:
if i change the index:
i get this:
on the off chance that one of the 3 people who still check this forum knows, is there really no way to access data further than one bar back?
To get the high price of the 5th bar back from the current bar in Tradovate, use:
csharp
Copy code
double highPrice = High[5];
This retrieves the high of the bar 5 periods ago.
Automation Tip: For automating your trades, consider PickMyTrade, which integrates with trading platforms like Tradovate. It helps optimize and automate your strategies for more efficient, consistent trading
im trying to build an indicator within tradovates javascript environment, not using their api so this does not work.
specifically i am trying to access the profile data(bidvol/askvol) from previous bars
I am code developer and can assist you with this. if you send me an email on timmfain@gmail.com, we can see how to implement your requirements.