GithubHelp home page GithubHelp logo

01010010-01010011 / ninjaviewpythonsnip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ninjaview/ninjaviewpythonsnip

0.0 0.0 0.0 39 KB

This document provides detailed instructions on how to run a Python script that is a part of the NinjaView application. The provided script is a snippet to demonstrate that Ninja Trader is not a virus, though it might trigger false positive alerts in some antivirus programs when compiled with PyInstaller.

Python 100.00%

ninjaviewpythonsnip's Introduction

Understanding NinjaView: Understanding How NinaView Works and Addressing Potential Antivirus Flags

Introduction

This document serves as an informative guide, detailing the functionality and setup process of a Python script integral to the NinjaView application. It is worth mentioning that, although the application is secure, certain antivirus programs might mistakenly identify it as a potential threat. This document aims to address these concerns and guide users through the installation and execution process.

nv.py uses NinjaTrader's Advanced Trade Interface (ATI) to place trades and manage orders. It establishes a connection to NinjaTrader's ATI port and sends trading commands directly, ensuring a seamless and swift execution of trades. Below is a simplified example of how it sends a trade command to NinjaTrader:

import os
import winreg
import sys
import uuid
import time
import logging
import hashlib
import socket
import signal
import threading
import psutil
import PIL.Image
import tkinter as tk
import base64
import atexit
import subprocess
import requests
import pyperclip
import base64
from tkinter import simpledialog, messagebox, filedialog
from io import BytesIO
from datetime import datetime
from pystray import Icon as icon, Menu as menu, MenuItem as item
from threading import Thread as FlaskThread
import flask
from flask import request, jsonify, current_app
ngrok_process = None
is_verified = False
ngrok_started = False
public_url = None
details = {
    "ngrokAUTHTOKEN": "Default",
    "ngrokDOMAIN": "Default",
    "ngrokLOCATION": "Default"
}

def send_ati_command(command):
    try:
        # Connect to NinjaTrader ATI port
        with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
            s.connect(('localhost', 36973))  # Adjust IP and port as necessary
            s.sendall(command.encode())
            data = s.recv(1024)
            print('Received', repr(data))
    except Exception as e:
        print("An error occurred:", e)

# Example command (replace with actual ATI command)
command = "PLACE;Account=Sim1;Instrument=ES 12-23;Action=BUY;Qty=1;OrderType=LIMIT;LimitPrice=4139;TIF=DAY"
send_ati_command(command)

Why is NinjaView a Paid Application?

NinjaView is a paid application because it represents the culmination of extensive research, development, and overcoming numerous challenges to provide a reliable and effective trading solution. The integration with NinjaTrader through its ATI port, as demonstrated in nv.py, required significant time and effort to perfect. Your purchase and support ensure continued development, improvements, and customer support for NinjaView, enabling traders to enhance their trading experience seamlessly.

Building Trust in a New Frontier

NinjaView is a relatively new entrant in the trading software domain. We understand that building trust within the trading community takes time, especially when introducing innovative solutions that have never been seen before. Our commitment to transparency, security, and relentless improvement is unwavering. We are here to revolutionize trading automation and provide traders with unparalleled tools for success.

We encourage users to reach out with any questions, concerns, or feedback. Your insights and experience with NinjaView are invaluable to us and the wider trading community. Together, we are shaping the future of trading automation.

Prerequisites

Before proceeding, ensure that you have the following prerequisites installed on your system:

  • Python: Version 3.6 or later
  • pip: A package installer for Python

You can install the required Python packages using the following command:

pip install flask pystray Pillow requests psutil pyperclip

Setting Up the Script

Download the Script: Clone the repository or download the script from the provided source. Navigate to the Script's Directory: Use your command line tool to go to the script's folder. cd path/to/script/directory

Install Virtual Environment (Optional): It is a good practice to create a virtual environment to isolate the project dependencies.

cd path/to/script/directory

python -m venv venv
.\venv\Scripts\activate  # On Windows
source venv/bin/activate  # On Unix or MacOS

Install Requirements: Install the required packages using pip:

pip install -r requirements.txt
or
pip install flask pystray Pillow requests psutil pyperclip

Note: Some of the packages that might be required include os, winreg, sys, uuid, time, logging, hashlib, signal, threading, psutil, PIL, tkinter, base64, atexit, subprocess, requests, pyperclip, pystray, flask, and ngrok.

Running the Script Execute the Script: Run the script using Python.

python nv.py

Compiling with PyInstaller Install PyInstaller: If you don’t have PyInstaller installed, you can install it using pip:

pip install pyinstaller

Compile the Script: Use PyInstaller to compile the script.

pyinstaller --onefile --noconsole nv.py

If you want to add an icon to the executable, you can use the --icon option (This will cause more false anti-virus flags:

pyinstaller --onefile --noconsole --icon=icon.ico nv.py

Replace icon.ico with the path to your icon file.

Scan your compiled .exe

http://virustotal.com/

[email protected]

Note on False Positive Antivirus Flags

When compiling Python scripts to executable files using PyInstaller, the resulting executable might be flagged by some antivirus programs as suspicious or malicious. This is a known issue with PyInstaller and other similar tools, and it happens because:

Heuristic Analysis: Antivirus programs use heuristic analysis to detect unusual patterns that might indicate malicious behavior. Compiled Python scripts often exhibit such patterns because the Python interpreter, script, and all dependencies are bundled into a single executable file.

Code Obfuscation: Some parts of the Python script may be obfuscated to protect intellectual property, which can trigger false positives.

Lack of Reputation: Newly created or rarely downloaded files might not have an established reputation, making them more likely to be flagged as potential threats.

Use in Malware: Unfortunately, attackers sometimes use tools like PyInstaller to package malicious scripts, which has led to a negative reputation for executables created with these tools.

ninjaviewpythonsnip's People

Contributors

ninjaview avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.