Trading System Getting Stopped

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #192351 quote
    ashehzi
    Participant
    Average

    Hi,

    I am getting below message when looking at the warning of a stopped trading system:

    “The trading system was stopped because an indicator received a negative or zero parameter ex:(-10).

    You can modify your code to to prevent negative parameters then backtest the system to check the correction.”

    Is there a way to find where in the code I am getting it? I mean is there a way to debug it? or only option is to use graph/graphonprice?

    Regards.

    #192363 quote
    ashehzi
    Participant
    Average

    I see the problem now.

    TimesTraded=0
    FOR i=0 to 10 do
    if tradeprice(i) = myLong then
    TimesTraded = TimesTraded +1
    endif
    next

    where myLong is a number/support (e.g.  13010 on nas). All I am trying to do is if this level was traded by the program already.  Then, in my limit order I try to do:

     

    IF NOT LongOnMarket AND TIMEOPERATE AND LongCondition and TimesTraded < 3 THEN

    SET STOP LOSS Sl
    SET TARGET PROFIT ProfitLimit
    myBuyPrice = myLong
    ENDIF

    How can I fix the first part to avoid the system getting stopped because of the error mentioned in the first post? Any idea? Thanks

    #192375 quote
    Nicolas
    Keymaster
    Master

    Not sure the problem is located in this part of the code, are you sure you are not using an indicator with a zero or negative variable as a period?

    #192428 quote
    ashehzi
    Participant
    Average

    Thanks. I will check.

    Tonight right after its operating hour start at 1am (TIMEOPERATE = TIME>010000 AND TIME<205500 //1am to 855pm), it gave below error:

    The trading system was stopped due to a division by zero in one of its sub-functions during the evaluation of the last candlestick.
    You can add protections to your code to prevent divisions by 0 then backtest the system to check the correction.

    I will check my indicator.

    #192583 quote
    ashehzi
    Participant
    Average

    Hi,

    In below code, I try to see if a level has been used certain number of times but when I enable the strategy in automatic trading, on start of the candle, it gives error.

    traded3Times=0
    FOR i=0 to 10 do
    if tradeprice(i) = myLong then
    traded3Times = traded3Times +1
    endif
    next

    Results in

    The trading system was stopped because an indicator received a negative or zero parameter ex:(-10). 
    
    You can modify your code to to prevent negative parameters then backtest the system to check the correction.

    If no trade has happened, what is the default value of tradeprice?

    Regards.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Trading System Getting Stopped


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
ashehzi @ashehzi Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by ashehzi
3 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/28/2022
Status: Active
Attachments: No files
Logo Logo
Loading...