system "Maximum_Advantage_System"

{Maximum Advantage Roulette System

for Even Money Bets in Roulette
For instructions, download documentation
}
method "main"
begin
    While Starting a New Session
    begin
        Call "Initialize";
        Call "Input Data";
        Exit;
    end
    
    Call "Check Win Goal";
    Call "Check Loss Goal";
    Call "Store layout";
    Call "Track Last 2 Layouts";
    Call "Check Win/Loss";
    Call "Determine Rule Bet";
    Call "Determine Switch-Opposite";
    Call "Select Layout to Bet";
    Put 100% of Record "Bet Amount" data on Record "Layout to bet" layout;
end

method "Check Win Goal"
begin
    While Bankroll >= Record "Total Win Goal" data
    begin
        Display "Your Win Goal has been Reached.
                  
                  Session will End.";
        Stop Session;
    end
end

method "Check Loss Goal"
begin
    While Bankroll < Record "Total Loss Goal" data
    begin
        Display "Your Loss Goal has been Reached.
                  
                  Session will End.";
        Stop Session;
    end
end

{=================================================================
Controlled Risk Betting Strategy Section
=================================================================
}
method "Check Win/Loss"
begin
    While Record "Layout to bet" layout has won each time
    begin
        Call "Determine Win Rule";
    end
    
    While Record "Layout to bet" layout has lost each time
    begin
        Call "Determine Loss Rule";
    end
end

method "Determine Win Rule"
begin
    While Record "Rule Indicator" data = 1
    begin
        Return;
    end
    
    While Record "Rule Indicator" data = 3
    begin
        Put 4 on Record "Rule Indicator" data;
    end
    
    While Record "Layout to bet" layout has won more than 1 time
    begin
        Put 5 on Record "Rule Indicator" data;
    end
end

method "Determine Loss Rule"
begin
    While Record "Layout to bet" layout has lost 1 time
    begin
        Put 3 on Record "Rule Indicator" data;
    end
    
    While Flag "Switch-Opposite" is True
    begin
        Set Flag "Switch-Opposite" to False;
        Set Flag "Find Last Descision" to True;
        Set Flag "Lost After Switch-Opposite" to True;
    end
end

method "Determine Rule Bet"
begin
    While Record "Rule Indicator" data = 1
    begin
        //Rule A
        Put 100% of Record "Base Bet" data on Record "Bet Amount" data;
        Return;
    end
    
    While Record "Rule Indicator" data = 2
    begin
        Return;
    end
    
    While Record "Rule Indicator" data = 3
    begin
        //Rule C
        Add 100% of Record "Bet Increase after Loss" data
                                                    on Record "Bet Amount" data;

        If Record "Bet Amount" data > Record "Maximum Bet" data
        begin
            Put 100% of Record "Bet after Maximum Bet Loss" data
                                                    on Record "Bet Amount" data;
        end

        Return;
    end
    
    While Record "Rule Indicator" data = 4
    begin
        //Rule D
        Subtract 100% of Record "Bet Decrease after Win" data
                                                    on Record "Bet Amount" data;
        Return;
    end
    
    While Record "Rule Indicator" data = 5
    begin
        //Rule E
        Subtract 100% of Record "Bet Decrease after 2 Wins" data
                                                    on Record "Bet Amount" data;

        If Record "Bet Amount" data < Record "Base Bet" data
        begin
            Put 100% of Record "Base Bet" data on Record "Bet Amount" data;
            Put 1  on Record "Rule Indicator" data;
        end

        Return;
    end
end

{=================================================================
Adaptive Pattern Betting Method Section
=================================================================
}
method "Determine Switch-Opposite"
begin
    While Record "Layout to bet" layout has lost more than 1 time
    And  Flag "Switch-Opposite" is False
    And  Flag "Lost After Switch-Opposite" is False
    begin
        Set Flag "Switch-Opposite" to True;
    end
    
    While Flag "Switch-Opposite" is True
    begin
        Put 1 on record "Track Last 2 Layouts" layout index;
        Copy Record "Track Last 2 Layouts" layout to
                                                  Record "Layout to bet" layout;
    end
    
    Set Flag "Lost After Switch-Opposite" to False;
end

method "Select Layout to Bet"
begin
    While Flag "Find Last Descision" is True
    begin
        Set Flag "Find Last Descision" to False;
        Copy Record "Last Layout Decision" layout to
                                                  Record "Layout to bet" layout;
    end
end

method "Store Layout"
begin
    While Number 0 has hit each time
    Or Number 00 has hit each time
    begin
        Return;
    end
    
    While Record "Selected Layout" data = 1
    begin
        Call "Layout Even-Odd";
        Return;
    end
    
    While Record "Selected Layout" data = 2
    begin
        Call "Layout Red-Black";
        Return;
    end
    
    While Record "Selected Layout" data = 3
    begin
        Call "Layout High-Low";
        Return;
    end
end

method "Layout Even-Odd"
begin
    While Even has hit each time
    begin
        Copy Even to Record "Last Layout Decision" layout;
        Copy Odd to Record "Last Layout Opposite" layout;
    end
    Else
    begin
        Copy Odd to Record "Last Layout Decision" layout;
        Copy Even to Record "Last Layout Opposite" layout;
    end
end

method "Layout Red-Black"
begin
    While Red has hit each time
    begin
        Copy Red to Record "Last Layout Decision" layout;
        Copy Black to Record "Last Layout Opposite" layout;
    end
    Else
    begin
        Copy Black to Record "Last Layout Decision" layout;
        Copy Red to Record "Last Layout Opposite" layout;
    end
end

method "Layout High-Low"
begin
    While High has hit each time
    begin
        Copy High to Record "Last Layout Decision" layout;
        Copy Low to Record "Last Layout Opposite" layout;
    end
    Else
    begin
        Copy Low to Record "Last Layout Decision" layout;
        Copy High to Record "Last Layout Opposite" layout;
    end
end

method "Track Last 2 Layouts"
begin
    While Number 0 has hit each time
    Or Number 00 has hit each time
    begin
        Return;
    end
    Else
    begin
        if record "Track Last 2 Layouts" Layout count = 2 then
        begin
            Move List Up by 1 on record "Track Last 2 Layouts" layout;
        end

        Set Max on record "Track Last 2 Layouts" layout index;
        Add 1 to record "Track Last 2 Layouts" layout index;
        Copy Record "Last Layout Opposite" layout to
                                     Record "Track Last 2 Layouts" layout;
        Put 1 on record "Track Last 2 Layouts" layout index;

    end
end

method "Initialize"
begin
    Clear Record "Actual Level Bet Selection" data;
    Clear Record "Track Last 2 Layouts" layout;
    Clear Record "Total Win Goal" data;
    Clear Record "Total Loss Goal" data;
    Clear Record "Last Layout Opposite" data;
    Clear Record "Last Layout Decision" data;
    Clear Record "Layout to bet" data;
    Clear Record "Bet Amount" data;
    Clear Record "Table layout" data;
    Clear Record "Rule Indicator" data;
    Clear Record "Selected Layout" data;
    Clear Record "Level Bet" data;
    Clear Record "Win Goal" data;
    Clear Record "Loss Goal" data;
    Clear Record "Starting Bankroll" data;
    Clear Record "Base Bet" data;
    Clear Record "Maximum Bet" data;
    Clear Record "Bet after Maximum Bet Loss" data;
    Clear Record "Bet Increase after Loss" data;
    Clear Record "Bet Decrease after Win" data;
    Clear Record "Bet Decrease after 2 Wins" data;
    Set Flag "Find Last Descision" to false;
    Set Flag "Switch-Opposite" to false;
    Set Flag "Lost After Switch-Opposite" to false;
    Set Flag "Find Last Descision" to True;
    Set Flag "Switch-Opposite" to False;
    Set Flag "Lost After Switch-Opposite" to False;
    Put 1  on Record "Rule Indicator" data;
end

method "Input Data"
begin
    Group
    begin
        Display "Maximum Advantage Roulette is played in either Series A or B.
                  
                  Each Series has four Betting Levels in Units.";

        Input Dropdown "Make a Layout Selection
                  
                  1:=Even/Odd
                  2:=Red/Black
                  3:=High (19-36)/Low (1-18)" to Record "Selected Layout" data;

        Input Dropdown "What Table Layout do you want to use?
                  
                  1:=European Layout
                  2:=American Layout" to Record "Table layout" data;

        Input Dropdown "Betting Series to use?
                  
                  Note: A-1 represents Series A, Level 1
                  
                  1:= 5 units A-1
                  2:= 10 units A-2
                  3:= 15 units A-3
                  4:= 20 units A-4
                  5:= 10 units B-1
                  6:= 20 units B-2
                  7:= 30 units B-3
                  8:= 40 units B-4" to Record "Actual Level Bet Selection" data;

        Input Data "What is your Win Goal target?" to Record "Win Goal" data;
        Input Data "What is your Loss Goal target?" to Record "Loss Goal" data;
        Input Data "What is your Starting Bankroll?
                  
                  Recommended Bankroll for each Level is:
                  
                  Level 1 =   500 units
                  Level 2 = 1,000 units
                  Level 3 = 1,500 units
                  Level 4 = 2,000 units" to Record "Starting Bankroll" data;
    end
    
    //Calculate Series and Level Bet
    Put 100% of Record "Actual Level Bet Selection" data on Record "Level Bet" data;
    
    While Record "Level Bet" data > 4
    begin
        Subtract 4  on Record "Level Bet" data;
        Multiply 2  on Record "Level Bet" data;
    end

    //method "Calculate Base and Maximum Bet"
    Put 100% of Record "Level Bet" data on Record "Base Bet" data;
    Multiply 5  on Record "Base Bet" data;
    Put 100% of Record "Level Bet" data on Record "Maximum Bet" data;
    Multiply 27  on Record "Maximum Bet" data;
    Put 100% of Record "Level Bet" data on Record "Bet after Maximum Bet Loss" data;
    Multiply 15  on Record "Bet after Maximum Bet Loss" data;
    Put 100% of Record "Level Bet" data on Record "Bet Increase after Loss" data;
    Multiply 3  on Record "Bet Increase after Loss" data;
    Put 100% of Record "Level Bet" data on Record "Bet Decrease after Win" data;
    Multiply 2  on Record "Bet Decrease after Win" data;
    Put 100% of Record "Level Bet" data on Record "Bet Decrease after 2 Wins" data;
    Multiply 5  on Record "Bet Decrease after 2 Wins" data;
    Put 100% of Record "Starting Bankroll" data on Bankroll;
    Put 100% of Record "Starting Bankroll" data on Record "Total Win Goal" data;
    Put 100% of Record "Starting Bankroll" data on Record "Total Loss Goal" data;
    Add 100% of Record "Win Goal" data on Record "Total Win Goal" data;
    Subtract 100% of Record "Loss Goal" data on Record "Total Loss Goal" data;

    //Setup the Table Layout
    While Record "Table layout" data = 1
    begin
        Load Single Wheel;
    end
    Else
    begin
        Load Double Wheel;
    end
end


