# This file is generated by pto-pre-build.sh. Do not edit it manually.
# Wed 10 Jul 2024 04:34:31 PM EDT
# SOURCE NAME: jgtml_cli-ttf-proto-01-2406181221.py
########################
 
import argparse
import pandas as pd
import os
import sys

sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))

import realityhelper



def main():
  parser = argparse.ArgumentParser(description="Create mlf alpha CSV file")
  parser.add_argument("-i", "--instrument", required=True, help="Instrument name")
  parser.add_argument("-t", "--timeframe", required=True, help="Timeframe (e.g., D1, H4)")
  parser.add_argument("-uf", "--full", action="store_true", help="Use full dataset")
  parser.add_argument("-new", "--fresh", action="store_true", help="Use fresh data")
  parser.add_argument("-fr", "--force_read", action="store_true", help="Force to read CDS (should increase speed but relies on existing data)")
  parser.add_argument("-c", "--quotescount", type=int, default=-1, help="Number of quotes to retrieve (default: 333)")
  #lag_period
  parser.add_argument("-lp", "--lag_period", type=int, default=1, help="Lag period")
  #total_lagging_periods
  parser.add_argument("-tlp", "--total_lagging_periods", type=int, default=5, help="Total lagging periods")
  #dont_dropna
  parser.add_argument("-ddna", "--dont_dropna", action="store_true", help="Dont dropna")
  #columns_to_keep
  parser.add_argument("-ctk", "--columns_to_keep", nargs='+', help="List of selected columns to keep", default=None)
  #columns_to_drop
  parser.add_argument("-ctd", "--columns_to_drop", nargs='+', help="List of selected columns to drop", default=None)
  #verbose
  parser.add_argument("-v", "--verbose", action="store_true", help="Verbose")
  #force_refresh
  parser.add_argument("-f", "--force_refresh", action="store_true", help="Force refresh")
  #flag mfiao
  parser.add_argument("-mfiao", "--mfiao", action="store_true", help="Use mfiao")
  #drop_bidask
  parser.add_argument("-dba", "--drop_bidask", action="store_true", help="Drop bidask")
  
  parser.add_argument("-pn", "--patternname", help="Pattern Name", default="ttf")
  
  args = parser.parse_args()
  force_refresh=args.force_refresh if args.force_refresh else True if args.fresh else False
  
  #get_mfis_ao_zone_2407b_feature
  if args.mfiao:
    realityhelper.create_pattern_dataset__ttf_mfis_ao_2407a_pto_get_dataset_we_need_in_here__2407060929(                 args.instrument,
                            args.timeframe,
                            use_full=args.full if args.full else False,
                            force_refresh=force_refresh,
                            lag_period=args.lag_period,
                            total_lagging_periods=args.total_lagging_periods,
                            dropna=True if args.dont_dropna else False,
                            columns_to_keep=args.columns_to_keep,
                            columns_to_drop=args.columns_to_drop)
  else:
    if args.patternname == "ttf":
      realityhelper.get_mfis_ao_zone_2407b_feature(
                            args.instrument,
                            args.timeframe,
                            use_full=args.full if args.full else False,
                            force_refresh=force_refresh,
                            lag_period=args.lag_period,
                            total_lagging_periods=args.total_lagging_periods,
                            dropna=True if args.dont_dropna else False,
                            columns_to_keep=args.columns_to_keep,
                            columns_to_drop=args.columns_to_drop,
                            drop_bid_ask=True if args.drop_bidask else False,
                            patternname=args.patternname)
    else:
      realityhelper.get_mlf_feature_pattern(
                            args.instrument,
                            args.timeframe,
                            use_full=args.full if args.full else False,
                            force_refresh=force_refresh,
                            lag_period=args.lag_period,
                            total_lagging_periods=args.total_lagging_periods,
                            dropna=True if args.dont_dropna else False,
                            columns_to_keep=args.columns_to_keep,
                            columns_to_drop=args.columns_to_drop,
                            drop_bid_ask=True if args.drop_bidask else False,
                            patternname=args.patternname)
  #create_ttf_csv(args.instrument, args.timeframe, args.full if args.full else False, args.fresh, args.quotescount, args.force_read)

if __name__ == "__main__":
  main()
  