I am making a buy only indicator based on EMA and I want to add a rule which checks if my indicator with other symbol with different timeframe and also with different param let's say my current chart is HDFC in 5 min with large ema range set to 200 and I want to check if my indicator on 1 hour chart in Banknifty with large ema range set to 250 is in uptrend(ie. the latest signal was buy).
Let's say for example in the future I want to add another rule based on ADX then can I also access ADX through Foreign funcion. If yes then how to do it or if no then are there any other ways?
and Thank you for your reply! I appreciated it a lot.
I did as per your instructions and it is working but there seems to be some issue
this is how I did it in my code (EXAMPLE CODE).
SetForeign("HDFCBANK-I.NFO");
//CODE HERE (Note my real code also has other additional rules including adx, dmi etc.
RestorePriceArrays(True);
What I did: I plotted two charts one of symbol BankNifty let's call this chart1 and other of HDFC let's call this chart 2, then I took a formula and made two variations of it and named them formula1 and formula2 each respectively. Then, I kept formula2 as a normal strategy and applied it to chart2. Then, I tried to replicated the HDFC price chart with It's signals on chart1 and I did it in formula1 which I had applied to chart1. To replicated it i did it in the same way as I did it in my example code.
The issue: I am noticing that a few signals are missing in chart1 as compared to chart2. When I further investigated I noticed that a few candles were not matching in chart1 which caused the value of ADX to be different as compared to in chart2 which is why in a condition in my indicator relented to ADX did not match which caused the signal to disappear in chart1.
its obvious signals wont necessarily be the same if you are running them on different symbols.
And when you hide your code, it is unhelpful (time waste) because if you have a mistake in it, it wont be known.
You have to provide everything so someone else can replicate it.