indicator negative entry or zero parameter error message

Forums ProRealTime English forum ProOrder support indicator negative entry or zero parameter error message

Viewing 15 posts - 1 through 15 (of 16 total)
  • #145026

    Hi

    My live system (with IG) was automatically stopped with the error – indicator negative entry or zero parameter. My code is below and I am struggling to understand why this happened.

    I have back tested the system for several months on a tick by tick mode and had no such issues / errors. The live system was trading on the wall street (DFB) instrument using daily chart.

    Can you spot any error in the code? Any thoughts?

    Thanks

    Sachin

     

     

    #145028

    Try replacing line 73 with this one to make sure C is not zero:

     

    1 user thanked author for this post.
    #145054

    Thanks Roberto

    Also, in lines 49 and 62, is NOT LONGONMARKET and NOT SHORTONMARKET required as per the code to execute long / short trades?

    I thought different live systems did not communicate with each other and executed trades independently. However IG have told me that if there is already a long (or short) trade on an instrument, then a separate live system will not execute another long (or short) trade on the same instrument if NOT LONGONMARKET or NOT SHORTONMARKET is included in lines 49 and 62 i.e. it looks at open positions in the whole trading account not just the trading system itself

    Your thoughts please?

    #145059

    No, they are not required, bu since you embed a stop loss calculation within those IF…ENDIF’s , even when already OnMarket your SL would change despite no further position is opened.

    I always use NOT [Long/Short]ONMARKET, unless I move the calculation elsewhere to make sure SL is not always changed.

     

    2 users thanked author for this post.
    #145091

    I have back tested the system for several months on a tick by tick mode and had no such issues / errors

    Likely back test cannot catch it 🙂

    I did a test before to purposely create division with zero, back test run fine, but live will not, #140253

    1 user thanked author for this post.
    #161017

    Hi Roberto,

    I get the zero parameter error on the above code as well, use it as a condition for long/short entries. Any suggestion of how I should change it to avoid the zero issue?

    #161019

    There can’t be an error in those two lines, since all parameters are positive constants.

    The error must be somewhere else.

    #161022

    Thanks Roberto,

    I will try and run it again. This is the rest of the code…? I do not see anything funny except maybe barindex-tradeindex…?

    #161036

    I can’t run it because some variables are missing.

    Anyway, and ENDIF is missing at the end. Actually two ENDIF’s are missing but you can get rid of one just replacing IF at line 37 with ELSIF (which is logically correct).

    As to barindex-tradeindex… it is never used as an index, just for comparisons.

    #161053

    Apologies…I have added the missing variables so that it can run. Thanks for helping…

    #161054

    I just run it in AutoTrading.

    I’ll wait for errors, if any, then I’ll report what happened.

     

    1 user thanked author for this post.
    #161090

    It already entered a couple of trades with no errors.

     

    1 user thanked author for this post.
    #161103

    Let me know if that error occur again please.

    1 user thanked author for this post.
    #161515

    Yes thank you. I have experienced the same thing it did a couple of trades no problem and then suddenly it happened…?

    #161516

    Will do thank you…

Viewing 15 posts - 1 through 15 (of 16 total)

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