Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple Entry for Testing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Simple Entry for Testing

    I'm just getting started creating strategies. I was trying to write an entry that would get hit very quickly to help speed up my learning curve. That way I can play with writing profit target and stop loss code and get an idea of what is happening. The entry code I wrote for a Long is
    close[0] > close[1]
    Which I read as if the current close is greater than the previous close, then I have LongEntry().
    Shouldn't this get filled almost immediately after closing a position?

    Thanks, Tim

    #2
    Tim, welcome to our forums - it would trigger immediately for an uptick in realtime if you used the strategy with CalculateOnBarClose = false -



    In backtesting this is always set to 'true', as the indicator formation is not known, thus the condition would generate a long entry for each up bar according to your definition.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    105 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    53 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    35 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    38 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    74 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X