Different indicator for different instrument

Forums ProRealTime English forum ProBuilder support Different indicator for different instrument

Viewing 12 posts - 1 through 12 (of 12 total)
  • #41786

    I want an indicator on my chart showing the stoploss as a line beneath the bars (for a long trade).  But the stoploss must be calculated differently for different instruments as it’s based on the lowest value a given number of bars back – a different number of bars for each instrument.  But if I add the stoploss indicator for Amazon, say, looking 20 bars back, that indicator also appears on my Facebook chart based on 20 bars back, when I actually want the Facebook indicator to be based on 25 bars back.  How do I do that please?

    Also, is it possible to show on the chart a count of the bars going backwards with the most recent as bar 0?  Perhaps that gets a bit crowded, so how about showing the bar number on the floating window that opens when hovering on a bar.

    #41830

    Can you post the code of your indicator? This should be easy to fix.

    Opening a floating window is not possible in probuilder as far as I know.

    #41880

    I’m posting 3 indicators and one trading system, for Microsoft, the parameters for numbers of bars will differ for different instruments.  I’ve uploaded .itf files, which I hope is correct.

    Re the floating window, I meant to use the existing one that displays OHLC and other data for a bar when hovering on it.

    #41887

    I will have a look at this under the weekend and try to fix for you.

    Displaying in THIS floating window (e.g. the one builtin in PRT) should happen automatically but I must first have a look at your code.

    1 user thanked author for this post.
    #41895

    Thank you.  The built-in floating window does indeed open automatically when I hover over a bar, I simply (!) want the window to display the bar number as well as the OHLC etc data, please.

    #41935

    Hi John,

    I’m just looking at your indicators and you must help me a little bit since I fail to see what you want to do. For example your “indicator” capital returns only a fix value (5000*0.03). This value does not change. So do you need an indicator for that?  The result is 150. You can write it down on a piece of paper. (just kidding’)

    Same for your “indicator” microsoftbars. It is only defining constants, so there is nothing changing over the course of time.

    So finally the only real indicator you send is MicrosoftStopLoss. I changed this a little bit so your parameters can be entered for every stock you apply it to ( I think this is what you want?). It shows the 2 stop loss’ in the hovering window and as a channel on the chart. You change the colors to your liking. Please have a look.

    If you want help with the other indicators you must explain me what they shall accomplish.

     

    #41940

    You’re correct of course about the constants.  But I may want to change the £5000 or the 3%, so that’s easier to do if those numbers are in a separate indicator – that way, I don’t have to change numbers in lots of different systems.  (I’d presumed, originally, that I’d be able to do that on the fly, but it turns out I can’t.)

    Also, I may want the numbers of bars to change so it’s easier to do that once for each instrument instead of twice and where the numbers are buried in other code thus increasing the chances of inadvertently changing the code.

    And yes, it’s the microsoftstoploss indicator that’s the difficulty.  I want that indicator to apply only to the microsoft chart and to no other.  Similarly I want the googlestoploss indicator (where the data may be different from microsoft) to apply only to google.  At the moment, if I add the microsoft indicator to the microsoft chart, it’s added automatically to the google chart when I open that.  Does that make sense?

    #41943

    OK OK, now I think I understand your problem. That has nothing to do with the indicator itself. That is a setting in PRT. Check if the charts of stocks are linked to the same group (this would explain why the indicator pops up on all charts). Or you have defined your microsoft chart as “master chart”, so all new charts you open automatically adopt the same indicators.

    So this is something you have to change in your platform settings (Nicolas surely can tell you where exactly you change this ; I’m not that good with the platform myself) not in the indicator code.

    #41945

    The charts are not linked, and as far as I am aware I have not defined any chart as a master chart.  I cannot find a reference to a master chart in the user manuals, so I do not know what that is.

    Thank you for your help it’s appreciated, I’ll investigate further.

    #41978

    Master chart was a name I made up to express what I mean, template would have been the correct word. You have obviously defined somewhere the settings of the microsoft chart to be a template which is used when you open another chart. If you search the PRT documentation for defining chart templates you should find the solution.

    #42082

    OK thanks, but I think I’ll give up!  I don’t recall setting a chart as a template, but in any event, whichever chart I open first decides it’s the template chart, there’s no logic to this as far as I can see, but I really do appreciate your help.

    #42084

    I this it is simply the default setting of the platform.


    @Nicolas
    : I’m sure you know the answer to this. When one opens a new chart from your watchlist for example, how can you define the default settings of the chart that opens?

Viewing 12 posts - 1 through 12 (of 12 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login