Syntax error: BUY is incorrect?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #97050 quote
    richarjo
    Participant
    Senior

    Hi, I am trying to code a bot and it comes up with this syntax error wherein it indicates that BUY is incorrect.  I am not sure what the problem may be and would welcome any suggestion on how to correct it.

     

    thanks

    Indicator1 = close
    Indicator2 = KS
    Indicator3 = CS
    Indicator4 = SA
    indicator5 = ExponentialAverage[5](close)
    c1=(Indicator1 > Indicator2)
    c2=(Indicator1 > CS AND SA)
    // Conditions to enter long positions
    IF (c1 AND c2)THEN Buy possize CONTRACT AT MARKET
    ENDIF
    #97052 quote
    GraHal
    Participant
    Master

    It would be so much eaiser if you use  the blue Insert PRT Code button on the far right of the message toolbar.

    What are KS, CS and SA ?

    possize = 1
    Indicator1 = close				
    Indicator2 = KS				
    Indicator3 = CS				
    Indicator4 = SA				
    indicator5 = ExponentialAverage[5](close)	
    c1=(Indicator1 > Indicator2)			
    c2=(Indicator1 > CS AND SA)			
    // Conditions to enter long positions		
    IF (c1 AND c2) THEN 
    Buy possize CONTRACT AT MARKET
    ENDIF
    #97053 quote
    robertogozzi
    Moderator
    Master

    The problem was THEN, it cannot be followed by anything but comments on the same line.

    GraHal’s correction works fine.

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

Syntax error: BUY is incorrect?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
richarjo @richarjo Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by robertogozzi
6 years, 10 months ago.

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